serverless/lib/utils/createFromTemplate.test.js
2019-07-02 10:25:32 +02:00

27 lines
718 B
JavaScript

'use strict';
const path = require('path');
const chai = require('chai');
const { existsSync } = require('fs-extra');
const installTemplate = require('./createFromTemplate');
const { getTmpDirPath } = require('../../tests/utils/fs');
chai.use(require('chai-as-promised'));
const expect = chai.expect;
describe('#createFromTemplate()', () => {
let tmpDirPath;
beforeEach(() => {
tmpDirPath = getTmpDirPath();
return installTemplate('aws-nodejs', tmpDirPath);
});
it('should create from template', () =>
expect(existsSync(path.join(tmpDirPath, 'serverless.yml'))).to.be.true);
it('should handle .gitignore', () =>
expect(existsSync(path.join(tmpDirPath, '.gitignore'))).to.be.true);
});