archive.js 550 B

1234567891011121314151617181920
  1. import { test } from 'ava';
  2. import { removeAsync } from 'fs-extra-promise';
  3. import { compress } from '../dist/lib/archive';
  4. import { tmpName, tmpFile, tmpDir } from '../dist/lib/util';
  5. (process.env.CI ? test.skip : test)('compress', async (t) => {
  6. // Don't use `tmpFile`, which keeps the file open and results in exceptions when spawning.
  7. const path = await tmpName();
  8. const code = await compress('./assets/', [ './project/index.html', './project/package.json' ], 'zip', path);
  9. t.is(code, 0);
  10. await removeAsync(path);
  11. });