question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[beta] ES6: Export: One of Import's siblings - Tests not passing

See original GitHub issue

Challenge export-one-of-imports-siblings has an issue. User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36.

export const foo = "bar";
export const boo = 'far';

I’m unable to make the tests pass for this challenge, even though the code is correct.

The strange thing is that the tests seem to work when eval()ed in a normal browser console. failing_regex However, they don’t work in the freeCodeCamp environment.

I initially assumed this was a regex error but since they work in the console, I’m not sure anymore.

Another thing worth noting is that these tests have the same problem as i pointed out in #12739 (comment)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
BerkeleyTruecommented, Feb 6, 2017

While export is valid es.next syntax, it is currently unsupported by all browsers. The reason for this is that while the syntax has entered the spec, the actual importing of those files has not been defined yet.

In order to teach the syntax we will need to encode those instances of syntax into something that is currently valid javascript (probably a coded comment) and then test for the existence of that comment.

1reaction
Greenheartcommented, Jan 28, 2017

I am pretty sure this issue is caused by our transpilation of the code from ES6 to ES5. Since the code we’re running tests against doesn’t have the ES6 code, they can never pass for the regex-tests checking for ES6 syntax.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - ES6 unit testing - importing and exporting modules
ES6 Modules allow you to keep you code isolated. By not placing the class Calculator in the global scope you can reference a...
Read more >
Tree-shaking with webpack 2 and Babel 6 - 2ality
First, all ES6 module files are combined into a single bundle file. In that file, exports that were not imported anywhere are not...
Read more >
Are most people not using ESM (import/export) syntax even in ...
All I want is this: A test framework that supports ESM syntax. The ability to run and debug these tests in VSCode. The...
Read more >
Module Federation - webpack
A chunk loading operation is usually an import() call, but older constructs like require.ensure ... Sibling containers cannot override each other's modules.
Read more >
Changelog - Cypress Documentation
Fixed an issue where the query object was not available on requests from cy.intercept() once ... Cypress 10 now includes beta support for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found