Skip to content

Commit fe8fbb0

Browse files
author
Loïc Mangeonjean
committed
test: update tests with new error messages
1 parent 242c032 commit fe8fbb0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/rollup-plugin-import-meta-assets/test/integration.test.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ describe('rollup-plugin-import-meta-assets', () => {
237237
error = e;
238238
}
239239

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

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

252254
expect(consoleStub.callCount).to.equal(2);
253255
expect(consoleStub.getCall(0).args[0]).to.match(
254-
/ENOENT: no such file or directory, open '.*[/\\]absolute-path\.svg'/,
256+
/\(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"/,
255257
);
256258
expect(consoleStub.getCall(1).args[0]).to.match(
257-
/ENOENT: no such file or directory, open '.*[/\\]missing-relative-path\.svg'/,
259+
/\(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"/,
258260
);
259261
});
260262

0 commit comments

Comments
 (0)