serverless/tests/utils/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

24 lines
596 B
JavaScript

'use strict';
const expect = require('chai').expect;
const testUtils = require('./index');
describe('Test utils', () => {
describe('#getTmpDirPath()', () => {
it('should return a valid tmpDir path', () => {
const tmpDirPath = testUtils.getTmpDirPath();
expect(tmpDirPath).to.match(/.+.{16}/);
});
});
describe('#getTmpFilePath()', () => {
it('should return a valid tmpFile path', () => {
const fileName = 'foo.bar';
const tmpFilePath = testUtils.getTmpFilePath(fileName);
expect(tmpFilePath).to.match(/.+.{16}.{1}foo\.bar/);
});
});
});