serverless/lib/plugins/rollback/index.test.js
Philipp Muens 8aad2372eb Refactor test structure
So that all tests follow the *.test.js pattern and globs are used to find test files.
2016-11-22 12:49:26 +01:00

35 lines
942 B
JavaScript

'use strict';
const expect = require('chai').expect;
const Rollback = require('./index');
const Serverless = require('../../Serverless');
describe('Rollback', () => {
let rollback;
let serverless;
beforeEach(() => {
serverless = new Serverless();
rollback = new Rollback(serverless);
});
describe('#constructor()', () => {
it('should have the command rollback', () => {
// eslint-disable-next-line no-unused-expressions
expect(rollback.commands.rollback).to.not.be.undefined;
});
it('should have a lifecycle events initialize and rollback', () => {
expect(rollback.commands.rollback.lifecycleEvents).to.deep.equal([
'initialize',
'rollback',
]);
});
it('should have a required option timestamp', () => {
// eslint-disable-next-line no-unused-expressions
expect(rollback.commands.rollback.options.timestamp.required).to.be.true;
});
});
});