Skip to content

Commit 89a8020

Browse files
test: normalize code EOF in each output chunk
1 parent 5dc0002 commit 89a8020

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/macros.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,23 @@ function cleanUpRollupOutput(output) {
66
return output.map(chunkOrAsset => {
77
if (chunkOrAsset.type === "asset") return chunkOrAsset;
88

9-
// These properties contain absolute paths,
10-
// and the path separator is not consistent between platforms.
9+
// These properties are inconsistent between platforms.
10+
// (absolute paths, end of line chars)
1111
const {
1212
dynamicImports,
1313
facadeModuleId,
1414
importedBindings,
1515
imports,
1616
modules,
1717
referencedFiles,
18+
code,
1819
...rest
1920
} = chunkOrAsset;
2021

21-
return { ...rest };
22+
return {
23+
...rest,
24+
code: code.replace(/\r\n|\n/g, "\n"),
25+
};
2226
});
2327
}
2428

0 commit comments

Comments
 (0)