serverless/test/unit/lib/plugins/config.test.js
Mariusz Nowak b4a25d70d3 feat: Remove tab autocomplete feature
Reasoning:
- Performance is very poor due to slow command startup time
- `tabtab` package is no longer maintained and shares security issues
- Feature usage is relatively low (telemetry data shows 7% of users has the autocompletion on)

BREAKING CHANGE:
Opt-in tab-tab autocompletion feature is removed due to performance and security issues
2022-01-27 15:21:58 +01:00

40 lines
1.2 KiB
JavaScript

'use strict';
const fs = require('fs');
const BbPromise = require('bluebird');
const { expect } = require('chai');
const config = require('@serverless/utils/config');
const runServerless = require('../../../utils/run-serverless');
BbPromise.promisifyAll(fs);
describe('Config', () => {
it('should support "config credentials" command', () =>
runServerless({
noService: true,
command: 'config credentials',
options: { provider: 'aws', key: 'foo', secret: 'bar' },
}));
it('should turn on autoupdate with "--autoupdate"', async () => {
await runServerless({
cwd: require('os').homedir(),
command: 'config',
options: { autoupdate: true },
modulesCacheStub: {
'./lib/utils/npmPackage/isGlobal.js': async () => true,
'./lib/utils/npmPackage/isWritable.js': async () => true,
},
});
expect(config.get('autoUpdate.enabled')).to.be.true;
});
it('should turn off autoupdate with "--no-autoupdate"', async () => {
await runServerless({
cwd: __dirname,
command: 'config',
options: { autoupdate: false },
});
expect(config.get('autoUpdate.enabled')).to.be.false;
});
});