Skip to content

Commit 47ccb24

Browse files
committed
ignore files and folders starting with dot in the tests
also switch folder to the fixture directory because some rollup plugins rely on `process.cwd()`.
1 parent dcf99c6 commit 47ccb24

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/index.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const constant = konst => () => konst;
1212

1313
const printTree = (nodes, indentLevel = 0) => {
1414
const indent = join(times(indentLevel, constant(' ')));
15-
return join(nodes.map(node =>
15+
return join(nodes.filter(node => node.name[0] !== '.').map(node =>
1616
`${indent}${node.name}\n${node.type === 'directory' ? printTree(node.children, indentLevel + 1) : ''}`
1717
));
1818
};
@@ -26,10 +26,13 @@ describe('fixtures', () => {
2626
}
2727

2828
it(fixtureDir, async () => {
29+
const prevDir = process.cwd();
30+
process.chdir(path.resolve(fixturePath));
2931
const output = await microbundle({
3032
cwd: path.resolve(fixturePath),
3133
formats: 'es,cjs,umd'
3234
});
35+
process.chdir(prevDir);
3336

3437
const printedDir = printTree([dirTree(fixturePath)]);
3538

0 commit comments

Comments
 (0)