File tree Expand file tree Collapse file tree 5 files changed +333
-51
lines changed Expand file tree Collapse file tree 5 files changed +333
-51
lines changed Original file line number Diff line number Diff line change 1+ require : ' ts-node/register'
2+ spec : ' tests'
3+ extension : ' ts'
Original file line number Diff line number Diff line change 1818 },
1919 "devDependencies" : {
2020 "@4tw/cypress-drag-drop" : " https://github.com/ccheraa/cypress-drag-drop" ,
21+ "chai" : " ^4.3.4" ,
2122 "cypress" : " 7.3.0" ,
2223 "lerna" : " 4.0.0" ,
23- "node-sass" : " 5.0.0"
24+ "mocha" : " ^8.4.0" ,
25+ "node-sass" : " 5.0.0" ,
26+ "sinon" : " ^10.0.0" ,
27+ "ts-node" : " ^9.1.1"
2428 },
2529 "resolutions" : {
2630 "node-gyp" : " ^7.0.0"
Original file line number Diff line number Diff line change 1+ import { expect } from "chai" ;
2+ import { ObjectClass } from "./obj" ;
3+
4+ describe ( 'test Object test' , ( ) => {
5+ let obj : ObjectClass ;
6+ before ( ( ) => {
7+ obj = new ObjectClass ( 5 ) ;
8+ } ) ;
9+ it ( 'Should exist' , ( ) => {
10+ expect ( obj ) . exist ;
11+ } ) ;
12+ it ( 'Should multiplay correctly' , ( ) => {
13+ const result = obj . multiply ( 4 ) ;
14+ expect ( result ) . to . equals ( 20 ) ;
15+ } ) ;
16+ } ) ;
Original file line number Diff line number Diff line change 1+ export class ObjectClass {
2+ constructor ( private multiplier = 1 ) { }
3+ multiply ( value : number ) : number {
4+ return value * this . multiplier ;
5+ }
6+ }
You can’t perform that action at this time.
0 commit comments