Freecodecamp: [beta] es6 challenge: import-vs-require-whats-the-difference test not working

Created on 22 Jan 2017  路  5Comments  路  Source: freeCodeCamp/freeCodeCamp


Challenge Name

https://beta.freecodecamp.com/en/challenges/es6/import-vs-require-whats-the-difference

Issue Description

the challenge don't accept my answer as correct. i think its a bug.

Browser Information

Chrome: Version 55.0.2883.87
windows 7
desktop

Your Code

import { capitalizeString } from "string_functions";
capitalizeString("hello!");

Most helpful comment

I'm getting a "require is not defined" error on submitting the correct solution.

All 5 comments

Another thing worth fixing for these tests are that they right now require explicit " for the import statement.

I think the regex should allow for either " or ', since the latter kind of string literals are very common.

To fix this, and also making sure that quotes always match, we could use a capture group like in the following regex.
(["'])someModuleToImport\1

I'm getting a "require is not defined" error on submitting the correct solution.

@forkerino Thanks for telling us! All ES6 code is transpiled before the tests gets executed but as we currently can't run our RegEx tests on the original ES6 code, this whole section is unreliable at the moment.

We're working on a fix, and this will definitely get resolved before it's released :blush:

Also getting the error, "require is not defined" upon submitting the correct solution.

Hi! Thanks for reporting and looking into this issue. We're tackling fixing the ES6 challenges in #12698. I'm closing this in favor of that issue.

Happy coding!

Was this page helpful?
0 / 5 - 0 ratings