Skip to content

Commit ac86190

Browse files
committed
test(client:util): add simple util test
1 parent 397ab7d commit ac86190

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { safeCb } from './util';
2+
3+
describe('Util', () => {
4+
it('Has a safeCb function', () => {
5+
let notAFunction = undefined;
6+
7+
<%_ if (filters.jasmine) { -%>
8+
expect(safeCb(notAFunction)).not.toThrowError();
9+
<%_ } if (filters.mocha) { -%>
10+
<%= expect() %>safeCb(notAFunction)<%= to() %>.not.throw(Error);
11+
<%_ } -%>
12+
});
13+
});

templates/app/spec.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@ import 'zone.js/dist/fake-async-test';
1313
var testsContext = require.context('./client', true, /\.(spec|test)\.<%= scriptExt %>$/);
1414
// testsContext.keys().forEach(testsContext);
1515
// testsContext('./app/main/main.component.spec.<%= scriptExt %>');
16+
testsContext('./components/util.spec.<%= scriptExt %>');
1617
<%_ if(filters.oauth) { -%>
1718
testsContext('./components/oauth-buttons/oauth-buttons.component.spec.<%= scriptExt %>');
18-
<%_ } else { -%>
19-
describe('filler', () => {
20-
it('fills', () => {
21-
console.log('The Filling');
22-
});
23-
});
2419
<%_ } -%>
2520

2621
import { TestBed, getTestBed } from '@angular/core/testing';

0 commit comments

Comments
 (0)