Closed GuilleW closed 1 year ago
Since I work on many files, I edit package.json to add useful shortcut to avoid misspelt filename.
package.json
"test-decaff": "npx coffee --compile --output spec spec/${npm_config_name}.coffee", "test-coffee": "jasmine-focused --captureExceptions --coffee spec/${npm_config_name}.coffee", "test-js": "jasmine-focused --captureExceptions spec/${npm_config_name}.js"
npx coffee --compile --output spec spec/list-spec.coffee
./bin/npm run test-decaff --name=list-spec
[x] Quality of Decaffeination
[x] Replace var with const and let if it's possible.
var
const
let
[x] Replace Nested Ternary Operators with if statements.
[x] Remove return when it's not needed.
return
[x] Remove Result Arrays when they are not needed.
[x] Replace for loops with for-of loops.
[x] Use Arrow Functions to write functions in a single line when it's possible.
[x] Remove unneeded ref variables.
[x] Remove do blocks and use let or const instead.
[x] Tests and assertions should be the same and success like in coffee file
coffee
From coffee
$ jasmine-focused --captureExceptions --coffee spec/list-spec.coffee // or my shortcut $ `./bin/npm run test-coffee --name=list-spec` > 8 tests, 24 assertions, 0 failures, 0 skipped
to js
$ jasmine-focused --captureExceptions spec/list-spec.js // or my shortcut $ `./bin/npm run test-js --name=list-spec` > 8 tests, 24 assertions, 0 failures, 0 skipped
Superseded by #78 having your commits brought in on newer changes.
As always appreciate all your effort here, thanks a ton!
Since I work on many files, I edit
package.json
to add useful shortcut to avoid misspelt filename.Steps to reproduce decaffeination (guidelines):
npx coffee --compile --output spec spec/list-spec.coffee
./bin/npm run test-decaff --name=list-spec
)[x] Quality of Decaffeination
[x] Replace
var
withconst
andlet
if it's possible.[x] Replace Nested Ternary Operators with if statements.
[x] Remove
return
when it's not needed.[x] Remove Result Arrays when they are not needed.
[x] Replace for loops with for-of loops.
[x] Use Arrow Functions to write functions in a single line when it's possible.
[x] Remove unneeded ref variables.
[x] Remove do blocks and use let or const instead.
[x] Tests and assertions should be the same and success like in
coffee
fileTest from coffee and JS should output same successful result :
From coffee
to js