speculate
Version:
Automatically generates an RPM Spec file for your Node.js project
43 lines (35 loc) • 892 B
JavaScript
;
const sinon = require('sinon');
const rimraf = require('rimraf');
const clean = require('../lib/clean');
const pkg = require('./fixtures/my-cool-api');
const sandbox = sinon.createSandbox();
describe('clean', () => {
beforeEach(() => {
sandbox.stub(rimraf, 'sync');
});
afterEach(() => {
sandbox.restore();
});
it('removes the existing service file', () => {
clean('/path/to/project', pkg);
sinon.assert.calledWith(
rimraf.sync,
'/path/to/project/my-cool-api.service'
);
});
it('removes the SPECS directory', () => {
clean('/path/to/project', pkg);
sinon.assert.calledWith(
rimraf.sync,
'/path/to/project/SPECS'
);
});
it('removes the SOURCES directory', () => {
clean('/path/to/project', pkg);
sinon.assert.calledWith(
rimraf.sync,
'/path/to/project/SOURCES'
);
});
});