File tree Expand file tree Collapse file tree 4 files changed +46
-0
lines changed
Expand file tree Collapse file tree 4 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ node_modules
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ assert : {
3+ equal : function ( one , two ) {
4+ return one === two
5+ }
6+ } ,
7+ test : { }
8+ } ;
Original file line number Diff line number Diff line change 1+ {
2+ "dependencies" : {
3+ "chai" : " ^3.5.0"
4+ }
5+ }
Original file line number Diff line number Diff line change 1+ var assert = require ( 'chai' ) . assert ;
2+ var myLib = require ( '../index.js' ) ;
3+
4+ describe ( 'MyLib' , function ( ) {
5+ it ( 'should be an object' , function ( ) {
6+ assert . equal ( typeof ( myLib ) , 'object' ) ;
7+ } ) ;
8+
9+ it ( 'should have a property called assert that is an object' , function ( ) {
10+ assert . equal ( typeof ( myLib . assert ) , 'object' ) ;
11+ } ) ;
12+
13+ it ( 'should have a property called test that is an object' , function ( ) {
14+ assert . equal ( typeof ( myLib . test ) , 'object' ) ;
15+ } ) ;
16+
17+ describe ( 'assert' , function ( ) {
18+ it ( 'should have a property called equal that is a function' , function ( ) {
19+ assert . equal ( typeof ( myLib . assert . equal ) , 'function' ) ;
20+ } ) ;
21+
22+ describe ( 'equal' , function ( ) {
23+ it ( 'should take two parameters and return whether they are equal or not' , function ( ) {
24+ assert . equal ( true , myLib . assert . equal ( 5 , 5 ) ) ;
25+ } ) ;
26+
27+ it ( 'should take two parameters and return whether they are exactly equal or not' , function ( ) {
28+ assert . equal ( false , myLib . assert . equal ( 5 , '5' ) ) ;
29+ } ) ;
30+ } ) ;
31+ } ) ;
32+ } ) ;
You can’t perform that action at this time.
0 commit comments