File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ const letters = require ( './index' ) ;
2+
3+ describe ( 'Data Structure : Set' , ( ) => {
4+
5+
6+ it ( 'X Set should be a Class' , ( ) => {
7+ expect ( typeof XSet . prototype . constructor ) . toEqual ( 'function' ) ;
8+ } ) ;
9+
10+ describe ( 'Creation of Set' , ( ) => {
11+
12+ it ( 'Should create a new Set with no elements' , ( ) => {
13+ letters = new XSet ( ) ;
14+ expect ( letters === 0 ) ;
15+ } ) ;
16+
17+ it ( 'Should add letter A' , ( ) => {
18+ letters . add ( 'a' ) ;
19+ expect ( letters . has ( 'a' ) ;
20+ } ) ;
21+
22+ it ( 'Should add letter B' , ( ) => {
23+ letters . add ( 'b' ) ;
24+ expect ( letters . has ( 'b' ) ;
25+ } ) ;
26+
27+ it ( 'Should add letter C' , ( ) => {
28+ letters . add ( 'c' ) ;
29+ expect ( letters . has ( 'c' ) ;
30+ } ) ;
31+
32+ it ( 'Should remove letter A' , ( ) => {
33+ letters . remove ( 'a' ) ;
34+ expect ( ! letters . has ( 'a' ) ;
35+ } ) ;
36+
37+ it ( 'Should remove letter B' , ( ) => {
38+ letters . remove ( 'b' ) ;
39+ expect ( ! letters . has ( 'b' ) ;
40+ } ) ;
41+
42+
43+ } ) ;
You can’t perform that action at this time.
0 commit comments