Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vdiez committed Nov 6, 2024
1 parent 4d7afbd commit 90c229f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/bridge/tests/router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import path from 'path';
import { start } from '../src/server.js';
import { request } from './tools/index.js';
import fs from 'fs';
import { describe, beforeEach, afterEach, it, mock, Mock } from 'node:test';
import { describe, before, after, it, mock, Mock } from 'node:test';
import { expect } from 'expect';

import { rule as S5362 } from '../../css/src/rules/S5362/index.js';
Expand All @@ -43,7 +43,7 @@ describe('router', () => {

let server: http.Server;

beforeEach(async () => {
before(async () => {
setContext({
workDir: '/tmp/dir',
shouldUseTypeScriptParserForJS: true,
Expand All @@ -56,7 +56,7 @@ describe('router', () => {
closePromise = serverClosed;
});

afterEach(async () => {
after(async () => {
await request(server, '/close', 'POST');
//We need to await the server close promise, as the http server still needs to be up to finish the response of the /close request.
await closePromise;
Expand Down
3 changes: 1 addition & 2 deletions packages/bridge/tests/worker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ describe('worker', () => {
worker.once('message', message => {
const { type, result } = message;
expect(type).toEqual('success');
expect(typeof result).toBe('string');
expect(JSON.parse(result)).toEqual({
expect(result).toEqual({
issues: [
expect.objectContaining({
ruleId: 'no-duplicate-selectors',
Expand Down

0 comments on commit 90c229f

Please sign in to comment.