Skip to content

Commit

Permalink
chore: cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Aug 10, 2024
1 parent 4cb5367 commit 88f374f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 22 deletions.
6 changes: 2 additions & 4 deletions app-min/test__if_not_no-unit-tests/my-app.spec.ext
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ import { describe, it } from 'vitest';
// @endif
import { MyApp } from '../src/my-app';
import { createFixture } from '@aurelia/testing';
import './setup';

describe('my-app', () => {
it('should render message', async () => {
const { assertText, startPromise } = createFixture(
const { assertText } = await createFixture(
'<my-app></my-app>',
{},
[MyApp],
);
).started;

await startPromise;
assertText('Hello World!', { compact: true });
});
});
8 changes: 7 additions & 1 deletion common/test__if_not_no-unit-tests/setup.ext
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ beforeAll(() => {
});

afterEach(() => {
fixtures.forEach(f => f.stop(true));
fixtures.forEach(async f => {
try {
await f.stop(true);
} catch {
// ignore
}
});
fixtures.length = 0;
});
1 change: 1 addition & 0 deletions jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"<rootDir>/test/**/*.spec./* @if babel */js/* @endif *//* @if typescript */ts/* @endif */"
],
"testEnvironment": "jsdom",
"setupFilesAfterEnv": ["./test/setup./* @if babel */js/* @endif *//* @if typescript */ts/* @endif */"],
"transform": {
"\\.(css|sass|scss|styl|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "jest-transform-stub",
// @if babel
Expand Down
5 changes: 0 additions & 5 deletions parcel/test__if_jasmine_or_mocha/all-spec.ext

This file was deleted.

6 changes: 2 additions & 4 deletions plugin-min/test__if_not_no-unit-tests/hello-world.spec.ext
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ import { describe, it } from 'vitest';
// @endif
import { HelloWorld } from '../src/hello-world';
import { createFixture } from '@aurelia/testing';
import './setup';

describe('my-app', () => {
it('should render message', async () => {
const { assertText, startPromise } = createFixture(
const { assertText } = await createFixture(
'<hello-world message="message"></hello-world>',
{ message: "foo" },
[HelloWorld],
);
).started;

await startPromise;
assertText('Hello World! foo', { compact: true });
});
});
1 change: 1 addition & 0 deletions vite/vitest.config.ext__if_vitest
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default mergeConfig(
exclude: [...configDefaults.exclude, "e2e/*"],
// @endif
root: fileURLToPath(new URL("./", import.meta.url)),
setupFiles: ["./test/setup./* @if babel */js/* @endif *//* @if typescript */ts/* @endif */"]
},
}),
);
8 changes: 0 additions & 8 deletions webpack/test__if_jasmine_or_mocha/all-spec.ext

This file was deleted.

0 comments on commit 88f374f

Please sign in to comment.