mirror of
https://github.com/hanzoai/workbox.git
synced 2026-09-24 17:04:35 +00:00
* Deps and config * Prettier output * Update hardcoded file sizes * More file size updates
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
const execa = require('execa');
|
|
const tempy = require('tempy');
|
|
const upath = require('upath');
|
|
|
|
const packagesToInstall = [
|
|
'workbox-build',
|
|
'workbox-cli',
|
|
'workbox-webpack-plugin',
|
|
];
|
|
|
|
let temporaryDirectory;
|
|
|
|
describe('[all] Yarn Installation', function () {
|
|
before(async function () {
|
|
temporaryDirectory = await tempy.directory();
|
|
});
|
|
|
|
for (const packageToInstall of packagesToInstall) {
|
|
it(`should install ${packageToInstall} using yarn`, async function () {
|
|
this.timeout(5 * 60 * 1000);
|
|
|
|
try {
|
|
const packagePath = upath.resolve('packages', packageToInstall);
|
|
await execa('yarn', ['add', packagePath], {cwd: temporaryDirectory});
|
|
} catch (error) {
|
|
if (error.code === 'ENOENT') {
|
|
// Skip the test if yarn isn't installed.
|
|
// (It will always be installed on GitHub Actions.)
|
|
this.skip();
|
|
} else {
|
|
throw error;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|