adjust test

due to changed behavior in nodejs minor version
https://github.com/nodejs/node/releases/tag/v20.18.3
https://github.com/nodejs/node/pull/54545
pull/2350/head
Mikael Finstad 1 year ago
parent 2503115490
commit 2503128fb6
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -25,11 +25,11 @@ describe('file uri both platforms', () => {
test('converts path to file url', () => { test('converts path to file url', () => {
expect(pathToFileURL('/test.jpg').href).toMatch(/^file:\/{3}.*test\.jpg$/); expect(pathToFileURL('/test.jpg').href).toMatch(/^file:\/{3}.*test\.jpg$/);
expect(pathToFileURL('/Users/sindresorhus/dev/te^st.jpg').href).toMatch(/^file:\/{2}.*\/Users\/sindresorhus\/dev\/te\^st\.jpg$/); expect(pathToFileURL('/Users/sindresorhus/dev/te^st.jpg').href).toMatch(/^file:\/{2}.*\/Users\/sindresorhus\/dev\/te%5Est\.jpg$/);
}); });
test('escapes more special characters in path', () => { test('escapes more special characters in path', () => {
expect(pathToFileURL('/a^?!@#$%&\'";<>').href).toMatch(/^file:\/{3}.*a\^%3F!@%23\$%25&'%22;%3C%3E$/); expect(pathToFileURL('/a^?!@#$%&\'";<>').href).toMatch(/^file:\/{3}.*a%5E%3F!@%23\$%25&'%22;%3C%3E$/);
}); });
test('escapes whitespace characters in path', () => { test('escapes whitespace characters in path', () => {

Loading…
Cancel
Save