1+ const expect = require ( 'chai' ) . expect ;
12const LinkedList = require ( './linkedlist' ) ;
23
34describe ( 'LinkedList' , function ( ) {
@@ -13,11 +14,11 @@ describe('LinkedList', function () {
1314 } ) ;
1415
1516 it ( 'should add elements to the tail and count size' , function ( ) {
16- expect ( list . toString ( ) ) . toEqual ( '1 -> 2 -> 3 -> 4' ) ;
17+ expect ( list . toString ( ) ) . to . equal ( '1 -> 2 -> 3 -> 4' ) ;
1718 } ) ;
1819
1920 it ( 'should have a size of 4' , function ( ) {
20- expect ( list . size ( ) ) . toBe ( 4 ) ;
21+ expect ( list . size ( ) ) . to . equal ( 4 ) ;
2122 } ) ;
2223 } ) ;
2324
@@ -31,11 +32,11 @@ describe('LinkedList', function () {
3132 } ) ;
3233
3334 it ( 'should add elements to the tail and count size' , function ( ) {
34- expect ( list . toString ( ) ) . toEqual ( '4 -> 3 -> 2 -> 1' ) ;
35+ expect ( list . toString ( ) ) . to . equal ( '4 -> 3 -> 2 -> 1' ) ;
3536 } ) ;
3637
3738 it ( 'should have a size of 4' , function ( ) {
38- expect ( list . size ( ) ) . toBe ( 4 ) ;
39+ expect ( list . size ( ) ) . to . equal ( 4 ) ;
3940 } ) ;
4041 } ) ;
4142
@@ -49,11 +50,11 @@ describe('LinkedList', function () {
4950 } ) ;
5051
5152 it ( 'should add elements to the tail and count size' , function ( ) {
52- expect ( list . toString ( ) ) . toEqual ( '4 -> 3 -> 2 -> 1' ) ;
53+ expect ( list . toString ( ) ) . to . equal ( '4 -> 3 -> 2 -> 1' ) ;
5354 } ) ;
5455
5556 it ( 'should have a size of 4' , function ( ) {
56- expect ( list . size ( ) ) . toBe ( 4 ) ;
57+ expect ( list . size ( ) ) . to . equal ( 4 ) ;
5758 } ) ;
5859 } ) ;
5960
@@ -68,20 +69,20 @@ describe('LinkedList', function () {
6869
6970 it ( 'should start with size of 3 after deleting one' , function ( ) {
7071 list . delete ( 4 ) ;
71- expect ( list . size ( ) ) . toBe ( 3 ) ;
72+ expect ( list . size ( ) ) . to . equal ( 3 ) ;
7273 } ) ;
7374
7475 it ( 'should have a size of 4' , function ( ) {
7576 list . delete ( 4 ) ;
7677 list . delete ( 2 ) ;
7778 list . delete ( 1 ) ;
7879 list . delete ( 3 ) ;
79- expect ( list . size ( ) ) . toBe ( 0 ) ;
80+ expect ( list . size ( ) ) . to . equal ( 0 ) ;
8081 } ) ;
8182
8283 it ( 'should not change if element not found' , function ( ) {
8384 list . delete ( 7 ) ;
84- expect ( list . size ( ) ) . toBe ( 4 ) ;
85+ expect ( list . size ( ) ) . to . equal ( 4 ) ;
8586 } ) ;
8687 } ) ;
8788
0 commit comments