Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

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

Conversation

scissorsneedfoodtoo
Copy link
Contributor

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

  • Your pull request targets the dev branch.
  • Branch starts with either fix/, feature/, or translate/ (e.g. fix/challenge-tests)
  • All new and existing tests pass the command npm test.
  • Use npm run commit to generate a conventional commit message.
    Learn more here: https://conventionalcommits.org/#why-use-conventional-commits
  • The changes were done locally on your machine and NOT GitHub web interface.
    If they were done on the web interface you have ensured that you are creating conventional commit messages.

Checklist:

  • Tested changes locally.
  • Addressed currently open issue (replace XXXXX with an issue no in next line)

Partially addresses #204

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.

ISSUES CLOSED: Partially addresses freeCodeCamp#204
@raisedadead raisedadead merged commit 674b156 into freeCodeCamp:dev Sep 20, 2018
@raisedadead
Copy link
Member

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

@scissorsneedfoodtoo
Copy link
Contributor Author

scissorsneedfoodtoo commented Sep 20, 2018

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!

@scissorsneedfoodtoo scissorsneedfoodtoo deleted the fix/main-repo-failing-test-suite branch September 20, 2018 14:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants