turingschool / front-end-curriculum

Turing Front-End Engineering Curriculum
http://frontend.turing.io
109 stars 120 forks source link

Check JS Foundations for impure functions #681

Open wvmitchell opened 1 year ago

wvmitchell commented 1 year ago

Description

In seeing students solve the current (new) JS foundations, some of the tests cannot be passed without creating an impure function. None of the tests should require this.

Summary of Changes

Notes

kaylagordon commented 1 year ago

An example is in spa tests:

 it.skip('should rack up a bill', function(){
    var nik = createCustomer('Nik', 0 , [])
    var footMassage = createService('foot massage', 65)
    var facial = createService('facial', 50)
    var nikFootMassage = bookServices(nik, footMassage)
    var nikFacial = bookServices(nik, facial)

    assert.deepEqual(nikFootMassage.bookings, ['foot massage','facial'])
    assert.deepEqual(nikFacial.bill, 115)
  })

Where you'd have to push the service into nik when bookServices is invoked in order for nikFootMassage and nikFacial to be connected.

sertmer commented 1 year ago

Notes for me: I'm also going to be keeping an eye on on wether or not to put them in any order. Might also fix some things like mis-named tests, confusing themes (vhs), file names

sertmer commented 1 year ago

Here's the PR for these changes :)

https://github.com/turingschool-examples/javascript-foundations/pull/115