11// launchcode.test.js code:
22const launchcode = require ( '../index.js' ) ;
33
4- describe ( "Testing launchcode" , function ( ) {
4+ describe ( "The launchcode object " , function ( ) {
55
6- // Write your unit tests here!
6+ test ( "should have a property called organization" , function ( ) {
7+ expect ( launchcode . organization ) . toEqual ( "nonprofit" ) ;
8+ } ) ;
9+ test ( "should have a property called executiveDirector" , function ( ) {
10+ expect ( launchcode . executiveDirector ) . toEqual ( "Jeff" ) ;
11+ } )
12+ test ( "should have a property called percentageCoolEmployees" , function ( ) {
13+ expect ( launchcode . percentageCoolEmployees ) . toEqual ( 100 ) ;
14+ } )
15+ test ( "should have a property called programsOffered with 3 programs" , function ( ) {
16+ expect ( launchcode . programsOffered [ 0 ] ) . toEqual ( "Web Development" ) ;
17+ expect ( launchcode . programsOffered [ 1 ] ) . toEqual ( "Data Analysis" ) ;
18+ expect ( launchcode . programsOffered [ 2 ] ) . toEqual ( "Liftoff" ) ;
19+ expect ( launchcode . programsOffered . length ) . toEqual ( 3 ) ;
20+ } ) ;
21+
22+ describe ( "should have a method called launchOutput, which" , function ( ) {
23+
24+ test ( "should return 'Launch!' for numbers evenly divisible by 2" , function ( ) {
25+ expect ( launchcode . launchOutput ( 2 ) ) . toEqual ( "Launch!" ) ;
26+ } ) ;
27+ test ( "should return 'Code!' for numbers evenly divisible by 3" , function ( ) {
28+ expect ( launchcode . launchOutput ( 3 ) ) . toEqual ( "Code!" ) ;
29+ } ) ;
30+ test ( "should return 'Rocks!' for numbers evenly divisible by 5" , function ( ) {
31+ expect ( launchcode . launchOutput ( 5 ) ) . toEqual ( "Rocks!" ) ;
32+ } ) ;
733
8- } ) ;
34+
35+
36+
37+
38+
39+
0 commit comments