Skip to content
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

lint testing on PRs, update node.js versions in CI #171

Merged
merged 1 commit into from
Dec 9, 2018

Conversation

msimerson
Copy link
Contributor

  • update node_js versions to released LTS versions
  • remove three instances of unnecessary escaping (lint)
  • enable lint testing as part of Travis CI tests

Questions:

  • your feelings on dropping support for node.js 4? (upstream has, I have, but it costs little to test, so there might be some value in leaving it on for testing. That way, you'll at least know when you've made a change that finally drives that nail in the coffin. OTOH, it'll prevent you from adopting some es6 features)

- update node_js versions to released LTS versions
- remove three instances of unnecessary escaping (lint)
- enable lint testing as part of Travis CI tests
@msimerson
Copy link
Contributor Author

msimerson commented Oct 5, 2018

Adding lint tests shows up in the Travis CI test output:

$ npm run lint
> sprintf-js@1.1.1 lint /home/travis/build/alexei/sprintf.js
> eslint .
The command "npm run lint" exited with 0.
1.25s
$ npm test
> sprintf-js@1.1.1 test /home/travis/build/alexei/sprintf.js
> mocha test/*.js
  sprintfjs
    ✓ should return formated strings for simple placeholders
    ✓ should return formated strings for complex placeholders
    ✓ should return formated strings for callbacks
  sprintfjs cache
    ✓ should not throw Error (cache consistency)
  sprintfjs
    ✓ should throw SyntaxError for placeholders
    ✓ %b should throw TypeError for invalid numbers
    ✓ %b should not throw TypeError for something implicitly castable to number
    ✓ %c should throw TypeError for invalid numbers
    ✓ %c should not throw TypeError for something implicitly castable to number
    ✓ %d should throw TypeError for invalid numbers
    ✓ %d should not throw TypeError for something implicitly castable to number
    ✓ %i should throw TypeError for invalid numbers
    ✓ %i should not throw TypeError for something implicitly castable to number
    ✓ %e should throw TypeError for invalid numbers
    ✓ %e should not throw TypeError for something implicitly castable to number
    ✓ %f should throw TypeError for invalid numbers
    ✓ %f should not throw TypeError for something implicitly castable to number
    ✓ %g should throw TypeError for invalid numbers
    ✓ %g should not throw TypeError for something implicitly castable to number
    ✓ %u should throw TypeError for invalid numbers
    ✓ %u should not throw TypeError for something implicitly castable to number
    ✓ %x should throw TypeError for invalid numbers
    ✓ %x should not throw TypeError for something implicitly castable to number
    ✓ %X should throw TypeError for invalid numbers
    ✓ %X should not throw TypeError for something implicitly castable to number
    ✓ should not throw Error for expression which evaluates to undefined
    ✓ should throw own Error when expression evaluation would raise TypeError
    ✓ should not throw when accessing properties on the prototype
  28 passing (16ms)

And if lint tests fails, the PR check fails. That lets contributors know their PR needs more work, without a maintainer having to point it out.

@alexei alexei merged commit 8cb8080 into alexei:master Dec 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants