renovate/test/static-files.spec.ts
Jamie Magee 8554df5c61 test: convert top level tests to typescript (#4526)
Also convert usage of chai to jest
2019-09-25 11:40:58 +02:00

23 lines
646 B
TypeScript

import util from 'util';
const glob = util.promisify(require('glob'));
const ignoredExtensions = ['js', 'ts', 'md', 'pyc', 'DS_Store', 'map'];
function filterFiles(files: string[]) {
return files.filter(file =>
ignoredExtensions.every(extension => !file.endsWith(`.${extension}`))
);
}
async function getFiles(dir: string) {
return filterFiles(await glob(`${dir}/**/*`, { dot: true, nodir: true })).map(
(file: string) => file.replace(`${dir}/`, '')
);
}
describe('static-files', () => {
it('has same static files in lib and dist', async () => {
expect(await getFiles('lib')).toEqual(await getFiles('dist'));
});
});