mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-25 02:57:31 +00:00
Add example use of karma (+ jasmine and chai)
This commit is contained in:
18
templates/Angular2Spa/ClientApp/tests/counter.ts
Normal file
18
templates/Angular2Spa/ClientApp/tests/counter.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'angular2-universal-polyfills';
|
||||
import { assert } from 'chai';
|
||||
import { Counter } from '../components/counter/counter';
|
||||
|
||||
describe('Counter component', () => {
|
||||
it('should start with value 0', () => {
|
||||
const instance = new Counter();
|
||||
assert.equal(instance.currentCount, 0);
|
||||
});
|
||||
|
||||
it('should increment the counter by 1 when requested', () => {
|
||||
const instance = new Counter();
|
||||
instance.incrementCounter();
|
||||
assert.equal(instance.currentCount, 1);
|
||||
instance.incrementCounter();
|
||||
assert.equal(instance.currentCount, 2);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user