mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
34 lines
923 B
JavaScript
34 lines
923 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Test: Serverless Integration
|
|
*/
|
|
|
|
const expect = require('chai').expect;
|
|
const exec = require('child_process').exec;
|
|
const path = require('path');
|
|
const TestsPlugin = require('../../lib/plugins/tests/tests');
|
|
|
|
describe('Serverless integration tests', () => {
|
|
it('should successfully run the "serverless test integration" command', (done) => {
|
|
const testsPlugin = new TestsPlugin();
|
|
|
|
const execute = (command, callback) => {
|
|
exec(command, (error, stdout, stderr) => {
|
|
if (stderr) {
|
|
throw new Error(stderr);
|
|
}
|
|
callback(stdout);
|
|
});
|
|
};
|
|
|
|
execute(`${path
|
|
.join(process.env.PWD, 'bin', 'serverless')} test integration --serverless-integration-test`,
|
|
(consoleOutput) => {
|
|
const commands = JSON.parse(consoleOutput);
|
|
expect(commands).to.deep.equal(testsPlugin.commands);
|
|
done();
|
|
});
|
|
});
|
|
});
|