Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 6994d59

Browse files
committed
Make assertions windows compatible
1 parent b37a7f3 commit 6994d59

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

test/index.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ const getModuleIdsFromBundle = (bundle) => {
178178
.reduce((moduleIds, chunk) => moduleIds.concat(Object.keys(chunk.modules)), []));
179179
};
180180

181-
// Tests in Rollup
182-
test(t => rollup({
181+
test('Works in rollup', t => rollup({
183182
input: './test/files/index.js',
184183
plugins: [alias({
185184
fancyNumber: './aliasMe',
@@ -191,9 +190,18 @@ test(t => rollup({
191190
.then((moduleIds) => {
192191
moduleIds.sort();
193192
t.is(moduleIds.length, 5);
194-
t.is(moduleIds[0].endsWith(path.normalize('/files/aliasMe.js')), true);
195-
t.is(moduleIds[1].endsWith(path.normalize('/files/folder/anotherNumber.js')), true);
196-
t.is(moduleIds[2].endsWith(path.normalize('/files/index.js')), true);
197-
t.is(moduleIds[3].endsWith(path.normalize('/files/localAliasMe.js')), true);
198-
t.is(moduleIds[4].endsWith(path.normalize('/files/nonAliased.js')), true);
193+
console.log(moduleIds);
194+
[
195+
'/files/aliasMe.js',
196+
'/files/folder/anotherNumber.js',
197+
'/files/index.js',
198+
'/files/localAliasMe.js',
199+
'/files/nonAliased.js',
200+
].forEach(
201+
(expectedId, index) => t.is(
202+
moduleIds[index].endsWith(expectedId),
203+
true,
204+
`expected ${moduleIds[index]} to end with ${expectedId}`,
205+
),
206+
);
199207
}));

0 commit comments

Comments
 (0)