Skip to content

Commit

Permalink
🧪 [Tests] Fix failing tests + bad Vitest config
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi committed Dec 7, 2024
1 parent 3657ec7 commit 9cf1595
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
4 changes: 2 additions & 2 deletions pkg/earwurm/src/Stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class Stack extends EmittenCommon<StackEventMap> {
static readonly #loadError = (
id: StackId,
path: string,
error: string,
error: unknown,
): StackError => ({
id,
message: [`Failed to load: ${path}`, getErrorMessage(error)],
Expand Down Expand Up @@ -170,7 +170,7 @@ export class Stack extends EmittenCommon<StackEventMap> {
).catch((error) => {
this.emit(
'error',
Stack.#loadError(this.id, this.path, getErrorMessage(error)),
Stack.#loadError(this.id, this.path, error),
);

return scratchBuffer(this.context);
Expand Down
3 changes: 1 addition & 2 deletions pkg/earwurm/src/tests/Stack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ describe('Stack component', () => {
id: mockStackId,
message: [
`Failed to load: ${mockPath}`,
// This string ends with `[object Request]`.
expect.stringContaining('Failed to parse URL from'),
expect.stringContaining('Failed to execute'),
],
});
});
Expand Down
2 changes: 2 additions & 0 deletions pkg/earwurm/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import dts from 'vite-plugin-dts';

import pkg from './package.json';

// TODO: We may need a unique `vitest.config.ts` file for this
// package... but simply adding that file does not appear to work.
export default defineConfig({
build: {
lib: {
Expand Down
14 changes: 0 additions & 14 deletions pkg/earwurm/vitest.config.ts

This file was deleted.

8 changes: 5 additions & 3 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ export default mergeConfig(
viteConfig,
defineConfig({
test: {
environment: 'happy-dom',
setupFiles: 'config/tests-setup',
sequence: {
concurrent: true,
},
// Not running tests concurrently because we would
// need to refactor many tests to more thoroughly reset
// between each test.
// sequence: {concurrent: true},
},
}),
);

0 comments on commit 9cf1595

Please sign in to comment.