forked from serverless/serverless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin-install.test.js
29 lines (24 loc) · 943 Bytes
/
plugin-install.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
const path = require('path');
const fsp = require('fs').promises;
const spawn = require('child-process-ext/spawn');
const fixturesEngine = require('../fixtures/programmatic');
const serverlessExec = require('../serverlessBinary');
describe('test/integration/plugin-install.test.js', function () {
this.timeout(1000 * 60 * 10); // Involves time-taking npm install
let serviceDir;
before(async () => {
serviceDir = (
await fixturesEngine.setup('function', {
// Unresolved variables should not block "plugin install" command
configExt: { variablesResolutionMode: '20210326', custom: { foo: '${foo:bar}' } },
})
).servicePath;
await spawn(serverlessExec, ['plugin', 'install', '-n', 'serverless-offline'], {
cwd: serviceDir,
});
});
it('should install plugin', async () => {
await fsp.access(path.resolve(serviceDir, 'node_modules/serverless-offline'));
});
});