Skip to content

Commit

Permalink
chore: updated types for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
webdeveric committed Apr 3, 2024
1 parent 61860b8 commit 95c2891
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1203,13 +1203,13 @@ describe('Options', () => {
writeToDisk: true,
});

const spy = vi.spyOn(compiler.outputFileSystem, 'writeFile');
const spy = vi.spyOn(compiler.outputFileSystem!, 'writeFile');

await run();

expect(spy).toHaveBeenCalled();

const content = (await promisify(compiler.outputFileSystem.readFile)(manifest.getOutputPath()))?.toString();
const content = (await promisify(compiler.outputFileSystem!.readFile)(manifest.getOutputPath()))?.toString();

expect(manifest.toString()).toEqual(content);
});
Expand Down
6 changes: 4 additions & 2 deletions test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export function makeCompiler(configuration: Configuration): Compiler {
...configuration,
});

compiler.outputFileSystem = createFsFromVolume(new Volume());
// eslint-disable-next-line @typescript-eslint/no-explicit-any
compiler.outputFileSystem = createFsFromVolume(new Volume()) as any;

return compiler;
}
Expand All @@ -47,7 +48,8 @@ export function makeMultiCompiler(configurations: Configuration[]): MultiCompile
),
);

compiler.outputFileSystem = createFsFromVolume(new Volume());
// eslint-disable-next-line @typescript-eslint/no-explicit-any
compiler.outputFileSystem = createFsFromVolume(new Volume()) as any;

return compiler;
}
Expand Down

0 comments on commit 95c2891

Please sign in to comment.