freeCodeCamp / curriculum

The freeCodeCamp curriculum and lesson editor
Creative Commons Attribution Share Alike 4.0 International
81 stars 124 forks source link

fix(schema): change schema and unpack script to fix tests in main repo #320

Closed scissorsneedfoodtoo closed 5 years ago

scissorsneedfoodtoo commented 5 years ago

Description

Added an additional argument to the getChallenges function call in unpack.js to act as a flag for when the unpack script is running. Then modified the lodash omit array so that translations are included in the array when the test suite is running, but excluded from the array when the unpack script is running. Effectively this means that the translations are not included in the challenge block when going through the test suite, but included in the challenge block for the unpack script. Finally I removed the unnecessary releasedOn section in unpackedChallenge.js, and removed both releasedOn and translations from challengeSchema.js.

All of these changes should fix the tests over on the main fCC branch.

Pre-Submission Checklist

Checklist:

Partially addresses #204

raisedadead commented 5 years ago

Just to confirm this will not need any changes over at the fCC main?

scissorsneedfoodtoo commented 5 years ago

No, nothing should need to be changed in main. I installed the latest npm package in the main staging branch, then modified the getChallenges.js file of the package like I did here, and ran the test suite. The tests seemed to pass fine!