Skip to content

Commit b7031b4

Browse files
committed
chore: import normalize test helper;
- adjusts newline character for Windows
1 parent 87da780 commit b7031b4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/index.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const sander = require('sander');
99

1010
const plugin = require('..');
1111

12+
// TODO(lukeed) do this within uvu?
13+
const normalize = file => fs.readFileSync(file, 'utf8').replace(/\r?\n/g, '\n');
14+
1215
test('resolves using pkg.svelte', () => {
1316
const { resolveId } = plugin();
1417
assert.is(
@@ -305,8 +308,8 @@ test('bundles CSS deterministically', async () => {
305308
});
306309

307310
assert.fixture(
308-
fs.readFileSync('test/deterministic-css/dist/bundle.css', 'utf-8'),
309-
fs.readFileSync('test/deterministic-css/expected/bundle.css', 'utf-8')
311+
normalize('test/deterministic-css/dist/bundle.css'),
312+
normalize('test/deterministic-css/expected/bundle.css')
310313
);
311314
});
312315

@@ -346,8 +349,8 @@ test('handles filenames that happen to contain .svelte', async () => {
346349
}
347350

348351
assert.fixture(
349-
fs.readFileSync('test/filename-test/dist/bundle.css', 'utf-8'),
350-
fs.readFileSync('test/filename-test/expected/bundle.css', 'utf-8')
352+
normalize('test/filename-test/dist/bundle.css'),
353+
normalize('test/filename-test/expected/bundle.css')
351354
);
352355
});
353356

0 commit comments

Comments
 (0)