Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test(`Call this.copyTemplate 3 times without 'dir' option`, t => {
const spy = chai.spy.on(context, 'copyTemplate');
TestUtils.call(context, 'writing');
expect(spy).to.have.been.called.exactly(3);
t.true(context.copyTemplate['src/app/myComponent.js'].length > 0);
t.true(context.copyTemplate['src/app/myComponent.html'].length > 0);
t.true(context.copyTemplate['src/app/myComponent.spec.js'].length > 0);
});
test(`Call this.copyTemplate 6 times`, t => {
const spy = chai.spy.on(context, 'copyTemplate');
TestUtils.call(context, 'writing');
expect(spy).to.have.been.called.exactly(files.length);
files.forEach(file => t.true(context.copyTemplate[file].length > 0));
});
test(`Call this.copyTemplate 2 times without 'dir' option`, t => {
const spy = chai.spy.on(context, 'copyTemplate');
TestUtils.call(context, 'writing');
expect(spy).to.have.been.called.exactly(2);
t.true(context.copyTemplate['src/app/service.js'].length > 0);
t.true(context.copyTemplate['src/app/service.spec.js'].length > 0);
});
test(`Call this.copyTemplate 2 times without 'dir' option`, t => {
const spy = chai.spy.on(context, 'copyTemplate');
TestUtils.call(context, 'writing');
expect(spy).to.have.been.called.exactly(2);
t.true(context.copyTemplate['src/app/myDirective.js'].length > 0);
t.true(context.copyTemplate['src/app/myDirective.spec.js'].length > 0);
});
test(`Call this.copyTemplate 2 times without 'dir' option`, t => {
const spy = chai.spy.on(context, 'copyTemplate');
TestUtils.call(context, 'writing');
expect(spy).to.have.been.called.exactly(2);
t.true(context.copyTemplate['src/app/myPipe.js'].length > 0);
t.true(context.copyTemplate['src/app/myPipe.spec.js'].length > 0);
});
test(`Call this.copyTemplate 22 times`, t => {
const spy = chai.spy.on(context, 'copyTemplate');
TestUtils.call(context, 'writing.src', {
version: require('../../package.json').version,
date: new Date().toString()
});
expect(spy).to.have.been.called.exactly(files.length);
files.forEach(file => t.true(context.copyTemplate[file].length > 0));
});
test(`Call this.copyTemplate 24 times`, t => {
const spy = chai.spy.on(context, 'copyTemplate');
TestUtils.call(context, 'writing.src', {
version: require('../../../package.json').version,
date: new Date().toString()
});
expect(spy).to.have.been.called.exactly(files.length);
files.filter(file => file !== 'src/index.css').forEach(file => t.true(context.copyTemplate[file].length > 0));
});
test(`Call this.copyTemplate 20 times`, t => {
const spy = chai.spy.on(context, 'copyTemplate');
TestUtils.call(context, 'writing.src', {
version: require('../../../package.json').version,
date: new Date().toString()
});
expect(spy).to.have.been.called.exactly(files.length);
files.forEach(file => t.true(context.copyTemplate[file].length > 0));
});
test(`Call this.copyTemplate 8 times`, t => {
const spy = chai.spy.on(context, 'copyTemplate');
TestUtils.call(context, 'writing.src', {
version: require('../../package.json').version,
date: new Date().toString()
});
expect(spy).to.have.been.called.exactly(files.length);
files.forEach(file => t.true(context.copyTemplate[file].length > 0));
});
test('Call this.config.set twice', () => {
context.config = {
set: () => {}
};
const spy = chai.spy.on(context.config, 'set');
TestUtils.call(context, 'configuring.config');
expect(spy).to.have.been.called.twice();
expect(spy).to.have.been.called.with('version');
expect(spy).to.have.been.called.with('props');
});