1
1
// launchcode.test.js code:
2
2
const launchcode = require ( '../index.js' ) ;
3
-
4
3
describe ( "Testing launchcode" , function ( ) {
5
4
6
5
// Write your unit tests here!
6
+ test ( "checking organization" , ( ) => {
7
+ expect ( launchcode . organization ) . toBe ( "nonprofit" ) ;
8
+ } )
7
9
8
- } ) ;
10
+ test ( "checking executive director" , ( ) => {
11
+ expect ( launchcode . executiveDirector ) . toBe ( "Jeff" ) ;
12
+ } )
13
+
14
+ test ( "checking the value of percentageCoolEmployees" , ( ) => {
15
+ expect ( launchcode . percentageCoolEmployees ) . toBe ( 100 ) ;
16
+ } )
17
+ test ( "checking the program offered" , ( ) => {
18
+ expect ( launchcode . programsOffered [ 0 ] ) . toBe ( "Web Development" ) ;
19
+ }
20
+ )
21
+ test ( "checking the program offered" , ( ) => {
22
+ expect ( launchcode . programsOffered [ 1 ] ) . toBe ( "Data Analysis" ) ;
23
+ }
24
+ )
25
+ test ( "checking the program offered" , ( ) => {
26
+ expect ( launchcode . programsOffered [ 2 ] ) . toBe ( "Liftoff" ) ;
27
+ } )
28
+ test ( "checking the program offered size" , ( ) => {
29
+ expect ( launchcode . programsOffered . length ) . toBe ( 3 ) ;
30
+ } )
31
+ test ( "checking number divisible by 2" , ( ) => {
32
+ expect ( launchcode . launchOutput ( 4 ) ) . toBe ( 'Launch!' ) ;
33
+ }
34
+ )
35
+ test ( "checking number divisible by 3" , ( ) => {
36
+ expect ( launchcode . launchOutput ( 9 ) ) . toBe ( 'Code!' ) ;
37
+ }
38
+ )
39
+ test ( "checking number divisible by 5" , ( ) => {
40
+ expect ( launchcode . launchOutput ( 25 ) ) . toBe ( 'Rocks!' ) ;
41
+ }
42
+ )
43
+ test ( "checking number divisible by 2&&3" , ( ) => {
44
+ expect ( launchcode . launchOutput ( 6 ) ) . toBe ( 'LaunchCode!' ) ;
45
+ }
46
+ )
47
+ test ( "checking number divisible by 3&&5" , ( ) => {
48
+ expect ( launchcode . launchOutput ( 15 ) ) . toBe ( 'Code Rocks!' ) ;
49
+ }
50
+ )
51
+ test ( "checking number divisible by 2&&5" , ( ) => {
52
+ expect ( launchcode . launchOutput ( 10 ) ) . toBe ( 'Launch Rocks! (CRASH!!!!)' ) ;
53
+ }
54
+ )
55
+ test ( "checking number divisible by 2,3&&5" , ( ) => {
56
+ expect ( launchcode . launchOutput ( 30 ) ) . toBe ( 'LaunchCode Rocks!' ) ;
57
+ }
58
+ )
59
+ test ( "checking number not divisible by 2,3&&5" , ( ) => {
60
+ expect ( launchcode . launchOutput ( 17 ) ) . toBe ( "Rutabagas! That doesn't work." ) ;
61
+ }
62
+ )
63
+ }
64
+ )
0 commit comments