aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/static-files.spec.js
blob: b4c4568bec9c0950eefe7f480d2cc268802d666e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const util = require('util');
const glob = util.promisify(require('glob'));

const ignoredExtensions = ['js', 'ts', 'md', 'pyc', 'DS_Store', 'map'];

function filterFiles(files) {
  return files.filter(file =>
    ignoredExtensions.every(extension => !file.endsWith(`.${extension}`))
  );
}

async function getFiles(dir) {
  return filterFiles(await glob(`${dir}/**/*`, { dot: true, nodir: true })).map(
    file => file.replace(`${dir}/`, '')
  );
}

describe('static-files', () => {
  it('has same static files in lib and dist', async () => {
    expect(await getFiles('lib')).toEqual(await getFiles('dist'));
  });
});