1
1
var describe = require ( 'mocha' ) . describe ;
2
2
var it = require ( 'mocha' ) . it ;
3
3
var os = require ( 'os' ) ;
4
- var ts = require ( 'typescript' ) ;
5
4
var fs = require ( 'fs' ) ;
6
5
var beforeEach = require ( 'mocha' ) . beforeEach ;
7
6
var afterEach = require ( 'mocha' ) . afterEach ;
8
7
var expect = require ( 'chai' ) . expect ;
9
8
var mockFs = require ( 'mock-fs' ) ;
10
9
var CancellationToken = require ( '../../lib/CancellationToken' )
11
10
. CancellationToken ;
11
+ var OperationCanceledException = require ( '../../lib/OperationCanceledException' )
12
+ . OperationCanceledException ;
12
13
13
14
describe ( '[UNIT] CancellationToken' , function ( ) {
14
15
beforeEach ( function ( ) {
@@ -63,7 +64,7 @@ describe('[UNIT] CancellationToken', function() {
63
64
) ;
64
65
} ) ;
65
66
66
- it ( 'should throw ts. OperationCanceledException error on cancelled' , function ( ) {
67
+ it ( 'should throw OperationCanceledException error on cancelled' , function ( ) {
67
68
var tokenA = new CancellationToken ( ) ;
68
69
expect ( function ( ) {
69
70
tokenA . throwIfCancellationRequested ( ) ;
@@ -72,7 +73,7 @@ describe('[UNIT] CancellationToken', function() {
72
73
var tokenB = new CancellationToken ( 'rgeer#R23r$#T$3t#$t43' , true ) ;
73
74
expect ( function ( ) {
74
75
tokenB . throwIfCancellationRequested ( ) ;
75
- } ) . to . throw ( ts . OperationCanceledException ) ;
76
+ } ) . to . throw ( OperationCanceledException ) ;
76
77
} ) ;
77
78
78
79
it ( 'should write file in filesystem on requestCancellation' , function ( ) {
0 commit comments