mocha - How to test harmony / ES6 / ECMAScript 6 JavaScript? -


According to the title, I have some AMD modules written in ES6 JS, which are running from nodejs .

I tried it before: Even after enabling - good faith in nodes, I ended up facing the internal reliance chain, where I had the similarity Was not able to enable istanbul , aspirima and others (I had opened one for it)

Then I went ahead, and here I got trapped ... strange . I enable both harmony for nodes and motcha, here is the test code: package.json

  "test ":" Node - hormone nod_module \\ mocha \\ bin \\ मोचा टेस्ट्स - hormonie-recursive "  

that I get from npm test my_test_folder command prompt. Even so, some ES6 constructions (like const ) pass properly, but then they explode on the demolition work. Here are the first output lines:

  const {log, dir} = required ('../ consolelogger.js'); ^ Syntex error: Unexpected token in module._compile (Module JS: 43 9: 25) on object. (Module .js: 474: 10) [... is continuing ...]   

I have also checked and heard about Transparency, , but I really do not know if they can work and now I am trying to do transparency in this matter.

How can any solution be resolved without changing all ES 6 bits in the code? TA

V8 does not yet implement demolition, so it is not available in the node for a while Will happen . Block scoping (mostly with contract) has been implemented, but know that a previous ES6 version of const was always available, so you can check what you are actually seeing - you 'go' for less ambiguity Try to Announce

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -