File tree Expand file tree Collapse file tree 7 files changed +26
-26
lines changed Expand file tree Collapse file tree 7 files changed +26
-26
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ describe('04 function increaseScore', () => {
1515 } ) ;
1616
1717 it ( 'shouldn\'t change scores under 95' , ( ) => {
18- var test = {
18+ const test = {
1919 score : 82
2020 } ;
2121 expect ( increaseScore ( test ) ) . to . deep . equal ( {
@@ -24,7 +24,7 @@ describe('04 function increaseScore', () => {
2424 } ) ;
2525
2626 it ( 'should change scores over 95 to 95' , ( ) => {
27- var test = {
27+ const test = {
2828 score : 84
2929 } ;
3030 expect ( increaseScore ( test ) ) . to . deep . equal ( {
@@ -39,7 +39,7 @@ describe('04 var mySlightlyChanged', () => {
3939 const mySlightlyChanged = map . __get__ ( 'mySlightlyChanged' ) ;
4040
4141 it ( 'should cap scores at 95' , ( ) => {
42- var scores = mySlightlyChanged . map ( function ( x ) {
42+ const scores = mySlightlyChanged . map ( function ( x ) {
4343 return x . score ;
4444 } ) ;
4545 expect ( Math . max . apply ( Math , scores ) ) . to . equal ( 95 ) ;
Original file line number Diff line number Diff line change 1- 'use strict' ;
2- var chai = require ( 'chai' ) ;
3- var spies = require ( 'chai-spies' ) ;
4- var expect = chai . expect ;
1+ const chai = require ( 'chai' ) ;
2+ const spies = require ( 'chai-spies' ) ;
3+ const expect = chai . expect ;
54chai . use ( spies ) ;
65
76// load('04/myFixed.js', true)
87if ( process . env . TASK_POSITION === '4' ) {
98 myFixed = [ ] ;
109}
11- var spy = chai . spy . on ( console , 'log' ) ;
12- // load('04-forEach.js')
10+ let spy = chai . spy . on ( console , 'log' ) ;
1311
14- describe ( '01 console.log' , function ( ) {
12+ const map = require ( 'BASE/04-forEach.js' ) ;
13+
14+ describe ( '01 console.log' , ( ) => {
1515
1616 if ( process . env . TASK_POSITION !== '4' ) {
17- it ( 'should be called 10 times' , function ( ) {
17+ it ( 'should be called 10 times' , ( ) => {
1818 expect ( spy ) . to . have . been . called . with ( 'A 95 Relational Databases' ) ;
1919 expect ( spy ) . to . have . been . called . with ( 'C 77 Networks' ) ;
2020 } ) ;
Original file line number Diff line number Diff line change 1- describe ( '02 console.log' , function ( ) {
1+ describe ( '02 console.log' , ( ) => {
22
33 if ( process . env . TASK_POSITION !== '4' ) {
4- it ( 'should begin with an index' , function ( ) {
4+ it ( 'should begin with an index' , ( ) => {
55 expect ( spy ) . to . have . been . called . with ( '1 A 95 Relational Databases' ) ;
66 expect ( spy ) . to . have . been . called . with ( '10 C 77 Networks' ) ;
77 } ) ;
Original file line number Diff line number Diff line change 1- describe ( '03 console.log' , function ( ) {
1+ describe ( '03 console.log' , ( ) => {
22
33 if ( process . env . TASK_POSITION !== '4' ) {
4- it ( 'should begin with an index' , function ( ) {
4+ it ( 'should begin with an index' , ( ) => {
55 expect ( spy ) . to . have . been . called . with ( '1/10 A 95 Relational Databases' ) ;
66 expect ( spy ) . to . have . been . called . with ( '10/10 C 77 Networks' ) ;
77 } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ describe ( '04 log' , ( ) => {
2+
3+ it ( 'should pass' , ( ) => {
4+ expect ( true ) . to . be . true ;
5+ } ) ;
6+
7+ } ) ;
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ function addOneToLog(x) {
8787Now that we see how ` forEach ` works, let's use it to make calls to the ` console ` .
8888
8989+ Use ` forEach ` to log out your report card to the console
90- @test ('04/01-forEach ')
90+ @test ('04/01')
9191@action (open('04-forEach.js'))
9292@action (set(
9393```
@@ -104,7 +104,7 @@ myFixed.forEach(::>);
104104@hint ('call ` forEach ` with ` logCourse ` ')
105105
106106+ Add a second parameter to ` logCourseWithIndex ` called ` index ` . Then call the function with ` myFixed.forEach ` .
107- @test ('04/02-forEach ')
107+ @test ('04/02')
108108@action (insert(
109109```
110110
@@ -121,7 +121,7 @@ myFixed.forEach(logCourseWithIndex);
121121@hint ('Add a second parameter to ` logCourseWithIndex ` ')
122122
123123+ Add a third parameter called ` array ` to ` logCourseWithIndexAndArray ` , then call the function with ` myFixed.forEach ` .
124- @test ('04/03-forEach ')
124+ @test ('04/03')
125125@action (insert(
126126```
127127
@@ -152,7 +152,7 @@ myFixed = students
152152
153153This is why side-effects are dangerous. Students data must have changed, and now all of your transformations are effected.
154154
155- @test ('04/04-forEach ')
155+ @test ('04/04')
156156@action (insert(
157157```
158158
You can’t perform that action at this time.
0 commit comments