File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change 1
- const { describe, test } = require ( 'node:test' ) ;
1
+ const { describe, it } = require ( 'node:test' ) ;
2
2
const assert = require ( 'assert' ) ;
3
3
const { Calculator } = require ( './main' ) ;
4
4
5
- describe ( 'Calculator' , ( ) => {
6
- const calc = new Calculator ( ) ;
7
- test ( 'exp' , ( ) => {
8
- assert . strictEqual ( calc . exp ( 0 ) , 1 ) ;
9
- assert . throws ( ( ) => calc . exp ( 'hello' ) , Error , 'unsupported operand type' ) ;
10
- assert . throws ( ( ) => calc . exp ( 10000 ) , Error , 'overflow' ) ;
11
- } ) ;
12
-
13
- test ( 'exp' , ( ) => {
14
- assert . strictEqual ( calc . log ( 1 ) , 0 ) ;
15
- assert . throws ( ( ) => calc . log ( - 1 ) , Error , 'math domain error (2)' ) ;
16
- assert . throws ( ( ) => calc . log ( 0 ) , Error , 'math domain error (1)' ) ;
17
- assert . throws ( ( ) => calc . log ( 'a' ) , Error , 'unsupported operand type' ) ;
18
- } ) ;
19
- } ) ;
You can’t perform that action at this time.
0 commit comments