pulsar-edit / ppm

Pulsar Package Manager
MIT License
35 stars 14 forks source link

Decaffeinate `spec/apm-cli-spec` #20

Closed GuilleW closed 1 year ago

GuilleW commented 2 years ago

Merge https://github.com/pulsar-edit/ppm/pull/19 first. EDIT : ❌ decaffeinate-project is used at first, then manual refactor/clean.

From coffee

$ jasmine-focused --captureExceptions --coffee spec/apm-cli-spec.coffee
> 6 tests, 24 assertions, 0 failures, 0 skipped

to js

$ jasmine-focused --captureExceptions spec/apm-cli-spec.js
> 6 tests, 24 assertions, 0 failures, 0 skipped
GuilleW commented 2 years ago

Following @confused-Techie comment, I forgot to follow Decaffeination guidelines.

Since I work on many files, I edit package.json to add useful shortcut to avoid misspelt filename.

    "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"

Steps to reproduce decaffeination:

Test from coffee and JS should output same successful result :

From coffee

$ jasmine-focused --captureExceptions --coffee spec/apm-cli-spec.coffee
// or my shortcut $ `./bin/npm run test-coffee --name=apm-cli-spec`
> 6 tests, 24 assertions, 0 failures, 0 skipped

to js

$ jasmine-focused --captureExceptions spec/apm-cli-spec.js
// or my shortcut $ `./bin/npm run test-js --name=apm-cli-spec`
> 6 tests, 24 assertions, 0 failures, 0 skipped
2colours commented 1 year ago

Supposedly superseded by https://github.com/pulsar-edit/ppm/pull/64.

confused-Techie commented 1 year ago

Again @2colours has very helpful refactored this PR into the modern decaf format in #64 and that has now been merged.

Thanks a ton to @2colours & @GuilleW for all the hard work here