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()`.
This commit is contained in:
Michel Rasschaert 2018-01-28 18:56:26 +01:00
parent dcf99c620a
commit 47ccb24d3c

View File

@ -12,7 +12,7 @@ const constant = konst => () => konst;
const printTree = (nodes, indentLevel = 0) => {
const indent = join(times(indentLevel, constant(' ')));
return join(nodes.map(node =>
return join(nodes.filter(node => node.name[0] !== '.').map(node =>
`${indent}${node.name}\n${node.type === 'directory' ? printTree(node.children, indentLevel + 1) : ''}`
));
};
@ -26,10 +26,13 @@ describe('fixtures', () => {
}
it(fixtureDir, async () => {
const prevDir = process.cwd();
process.chdir(path.resolve(fixturePath));
const output = await microbundle({
cwd: path.resolve(fixturePath),
formats: 'es,cjs,umd'
});
process.chdir(prevDir);
const printedDir = printTree([dirTree(fixturePath)]);