Skip to content

Commit

Permalink
test: update tests with new error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Oct 10, 2024
1 parent 242c032 commit fe8fbb0
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ describe('rollup-plugin-import-meta-assets', () => {
error = e;
}

expect(error.message).to.match(/no such file or directory/);
expect(error.message).to.eq(
`Unable to resolve "/absolute-path.svg" from "/home/loic/git/web/packages/rollup-plugin-import-meta-assets/test/fixtures/bad-url-entrypoint.js"`,
);
});

it('bad URL example with warnOnError: true', async () => {
Expand All @@ -251,10 +253,10 @@ describe('rollup-plugin-import-meta-assets', () => {

expect(consoleStub.callCount).to.equal(2);
expect(consoleStub.getCall(0).args[0]).to.match(
/ENOENT: no such file or directory, open '.*[/\\]absolute-path\.svg'/,
/\(rollup-plugin-import-meta-assets plugin\) test[/\\]fixtures[/\\]bad-url-entrypoint\.js \(1:26\) Unable to resolve "[/\\]absolute-path\.svg" from ".*bad-url-entrypoint\.js"/,
);
expect(consoleStub.getCall(1).args[0]).to.match(
/ENOENT: no such file or directory, open '.*[/\\]missing-relative-path\.svg'/,
/\(rollup-plugin-import-meta-assets plugin\) test[/\\]fixtures[/\\]bad-url-entrypoint\.js \(2:26\) Unable to resolve "..[/\\]..[/\\]missing-relative-path.svg" from ".*bad-url-entrypoint\.js"/,
);
});

Expand Down

0 comments on commit fe8fbb0

Please sign in to comment.