New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES 8 / ES 2017 #485
Merged
ES 8 / ES 2017 #485
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Current coverage is 70.00% (diff: 70.00%)@@ master #485 diff @@
==========================================
Files 14 12 -2
Lines 2022 1580 -442
Methods 434 0 -434
Messages 0 0
Branches 351 0 -351
==========================================
- Hits 1375 1106 -269
+ Misses 647 474 -173
Partials 0 0
|
Some integration tests are failing (see Travis output). This is related to the removed return statements, since they pass when resetting to the parent commit. |
sebn
force-pushed
the
es2017
branch
2 times, most recently
from
January 10, 2017 09:34
041a2b5
to
6f9bb70
Compare
|
Including: - Babel core and CLI - ES6/7/8 Babel presets - Array.prototype.includes Babel plugin - Auto-binding of class methods Babel plugin - Standard JS linter - Node source map support - nyc and babel-plugin-istanbul for coverage
Including: - ES6/7/8 presets - Array.prototype.includes support - Auto-binded class methods plugins - Istanbul instrumentation (in test env)
So we can see the git history later when running `git log --follow` on the *.js file
…cli) Using decaffeinate 2.41.0
A few lines of code were manually removed for coffee, then manually converted and introduced back in js, since it was making decaffeinate crash.
(Issue introduced by decaffeinate)
…block (Toplevel return is not ES6 module compliant)
Otherwise `this` is not binded to the test context.
This is how they are imported anyway. Not even sure why this used to work.
So: - we make use of the nice `import` syntax - `require()` doesn't use default import and fails in EcmaScript (Not sure why this used to work in CoffeeScript)
Already handled by babel-plugin-autobind-class-methods
sebn
force-pushed
the
es2017
branch
2 times, most recently
from
January 10, 2017 15:50
fc8e099
to
608fd16
Compare
So it can also be used in scripts, including Travis: - Use strict mode (needed for let statements) - Use module.exports (export statement isn't supported natively) - Passes eslint check
Lost while extracting App.registerRemote(): 7fac201#diff-5213ac8fbf5fc6caa4a679def1b21649 Coffeelint never complained...
Not sure it is supported when looking at babel-plugin-array-includes doc: https://github.com/stoeffel/babel-plugin-array-includes#pitfalls Althought it's actually covered by some passing test: https://codecov.io/gh/cozy-labs/cozy-desktop/src/682d4c3085ddd9b1653589d6c017256082632ec3/src/local/watcher.js#L350
So we don't need to import it in tests anymore
Wrapping it with babel-node since it requires uncompiled es8 test helpers.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Almost complete
Remaining work (for myself):
Fix: Property based testing stops the two cozy-desktop instances:Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
=> already failing randomly on masterFix: Property based testing has the same files and folders:Uncaught AssertionError: expected 1 to be 0 ... (test/integration/quickcheck.js:324:19)
=> already failing randomly on mastersrc/local/watcher:350
Shouldsource-map-support/register
go insrc/bin/cli.js
or inbin/cozy-desktop
? (latter is spawned directly in quickcheck tests, may help debug, but can't get any output anyway)Use cross-env for portable npm scriptstest/mocha.coverage.opts
useful or not? => no, it works without itRemove remaining uselessreturn
statements in converted codeTurn generated__guard__
methods in human-readable functionswhateverMethod.bind(this)
lines in generated class constructors => use babel-plugin-autobind-class-methods insteadRemove useless generatedArray.from
wrapping callsReplaceasync
withasync-es
?