mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
fix: don't duplicate type-only check on Windows (#385)
- gotta remember to normalize file names 🙃
- this fixes a failing test on Windows by fixing the underlying bug
- refactor: improve normalization in errors.spec
- normalize _all_ calls to `local`, instead of just one
- this doesn't affect the tests, only the source code change does, but I added this first and it's better practice / test future-proofing
This commit is contained in:
parent
eab48a3951
commit
c2b3db2300
@ -10,7 +10,7 @@ import * as helpers from "./helpers";
|
||||
// increase timeout to 15s for whole file since CI occassionally timed out -- these are integration and cache tests, so longer timeout is warranted
|
||||
jest.setTimeout(15000);
|
||||
|
||||
const local = (x: string) => path.resolve(__dirname, x);
|
||||
const local = (x: string) => normalize(path.resolve(__dirname, x));
|
||||
const cacheRoot = local("__temp/errors/rpt2-cache"); // don't use the one in node_modules
|
||||
|
||||
afterAll(async () => {
|
||||
@ -20,7 +20,7 @@ afterAll(async () => {
|
||||
});
|
||||
|
||||
async function genBundle(relInput: string, extraOpts?: RPT2Options, onwarn?: Mock) {
|
||||
const input = normalize(local(`fixtures/errors/${relInput}`));
|
||||
const input = local(`fixtures/errors/${relInput}`);
|
||||
return helpers.genBundle({
|
||||
input,
|
||||
tsconfig: local("fixtures/errors/tsconfig.json"),
|
||||
|
||||
@ -56,6 +56,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
|
||||
|
||||
const typecheckFile = (id: string, snapshot: tsTypes.IScriptSnapshot, tcContext: IContext) =>
|
||||
{
|
||||
id = normalize(id);
|
||||
checkedFiles.add(id); // must come before print, as that could bail
|
||||
|
||||
const diagnostics = getDiagnostics(id, snapshot);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user