mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
fix: missing tsconfig error shouldn't say undefined (#383)
- per the conditional above this line, `file` is falsey, so printing it doesn't make sense - per same conditional though, `pluginOptions.tsconfig` exists, so we can print that - fixes a test TODO/FIXME that had to workaround this bug as well
This commit is contained in:
parent
dcae517e38
commit
76109fcfe9
@ -34,7 +34,7 @@ test("integration - tsconfig errors", async () => {
|
||||
// TODO: move to parse-tsconfig unit tests?
|
||||
expect(genBundle("semantic.ts", {
|
||||
tsconfig: "non-existent-tsconfig",
|
||||
})).rejects.toThrow("rpt2: failed to open 'undefined'"); // FIXME: bug: this should be "non-existent-tsconfig", not "undefined"
|
||||
})).rejects.toThrow("rpt2: failed to open 'non-existent-tsconfig'");
|
||||
});
|
||||
|
||||
test("integration - semantic error", async () => {
|
||||
|
||||
@ -15,7 +15,7 @@ export function parseTsConfig(context: IContext, pluginOptions: IOptions)
|
||||
|
||||
// if the value was provided, but no file, fail hard
|
||||
if (pluginOptions.tsconfig !== undefined && !fileName)
|
||||
throw new Error(`rpt2: failed to open '${fileName}'`);
|
||||
throw new Error(`rpt2: failed to open '${pluginOptions.tsconfig}'`);
|
||||
|
||||
let loadedConfig: any = {};
|
||||
let baseDir = pluginOptions.cwd;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user