18 Commits
Author SHA1 Message Date
Tim OramandEduardo Diaz 53a76f1ca2 Add tests for private claims in the payload (#555)
This change adds tests for private claims added to the payload during
sign and ensures that after verifying the payload contains the expected
claim.
2018-12-14 15:17:45 +01:00
Tim OramandEduardo Diaz 18945ff721 Refactor tests related to jti and jwtid (#544)
This change extracts all tests related to the jti claim and the jwtid
option into a single test file. Additional tests were added that were
missing.
2018-11-23 12:12:59 +01:00
Tim OramandEduardo Diaz b280f8cc55 Refactor tests related to kid and keyid (#545)
Thie change extracts the tests related to the kid header and the keyid
option into a single file. Additonal tests were added that were missing.
2018-11-02 11:05:03 +01:00
Tim OramandEduardo Diaz 72223a1f2c Refactor tests related to iss and issuer (#543)
This change extracts all tests related to the iss claim and the issuer
option into a single test file. Additional tests were added that were
missing.
2018-11-02 11:02:16 +01:00
Tim OramandEduardo Diaz a4fcadd5b3 Implement async/sync tests for the aud claim (#535)
Refactor existing tests for the aud claim to use the async/sync test
helpers.
2018-10-17 11:37:29 +02:00
Tim OramandEduardo Diaz bb40b2103d Implement async/sync tests for nbf claim (#537)
Refactor the existing tests for the nbf claim to use the async/sync test
helpers. This required fixing a case where an error was improperly
handled for an async call.
2018-10-16 19:46:21 +02:00
Tim OramandEduardo Diaz da8a850628 Implement async/sync tests for exp claim (#536)
Refactor existing tests for the exp claim to use the async/sync test
helpers. This required fixing a case where an error was improperly
handled in the async case.
2018-10-16 18:57:20 +02:00
Tim OramandEduardo Diaz 86a40d8924 Implement async/sync tests for sub claim (#534)
Refactor existing tests for the sub claim to use the async/sync test
helpers.
2018-10-16 18:45:42 +02:00
Tim OramandEduardo Diaz 5ecfc5402e Create and implement async/sync test helpers (#523)
It is difficult to write tests that ensure that both the asynchronous
and synchronous calls to the sign and verify functions had the same
result. These helpers ensure that the calls are the same and return the
common result.

As a proof of concept, the iat claim tests have been updated to use the
new helpers.
2018-10-10 15:37:34 -03:00
Tim OramandEduardo Diaz 477e4f7426 Update dependencies used for running tests (#518)
Update chai and mocha to the latest versions and update nyc to the
latest version that supports Node 4.
2018-09-10 11:48:41 +02:00
Tim OramandEduardo Diaz cc7c764c64 Refactor tests related to iat and maxAge (#507)
This change extracts all tests related to the iat claim and the maxAge
verify option into two test files. Several additional tests are added
that were missing from the existing tests.
2018-08-26 12:52:15 +02:00
Tim OramandEduardo Diaz af874f5891 Refactor tests related to subject and sub (#505)
This change extracts all tests in the existing files related to the
subject option and sub claim into a single test file. Several other
tests are also added that were missing from the existing files.
2018-07-20 18:22:10 +02:00
Tim OramandEduardo Diaz 3d59ed478b Minor test refactoring for recently added tests (#504)
* Prefix claim- to claim related test files

* Fix typo of "signWithNoBfore" in notBefore tests
2018-07-20 18:14:02 +02:00
Tim OramandEduardo Diaz 86a39e7e9e Refactor tests related to audience and aud (#503)
This change extracts all tests in the existing test files related to
audience and aud into a single test file. Several other tests are also
added that were missing from the existing files.
2018-07-12 14:36:35 +02:00
Tim OramandEduardo Diaz 48edd0e3f7 Refactor tests related to expiresIn and exp (#501)
This change extracts all tests in the current test files related
to expiresIn and exp into a single test file. It also adds several
missing tests.
2018-07-06 23:40:49 +02:00
Tim OramandEduardo Diaz 6b0b47fc01 Refactor tests related to notBefore and nbf (#497)
This change extracts all tests in the current files related to notBefore
and nbf into a single test file. It also adds several missing related
tests.
2018-06-27 16:52:32 +02:00
Tim OramandEduardo Diaz c86e573d16 Complete ESLint conversion and cleanup (#490)
* Add extension to ESLint config file

The .eslintrc file without an extension was deprecated a few years ago,
so this change renames the file to add the required extension.

See: https://github.com/eslint/eslint/commit/c9a8883d450d63a8d044a9e66d275f5b1973a3ba

* Add ESLint to package.json

This change adds ESLint as a dev-dependency and adds a lint script that
will run ESLint.

* Complete switch from JSHint to ESLint

Convert all the JSHint rules to the ESLint equivalents where possible.
The no-undef rule in ESLint caught a few cases of undefined usages in
the tests, so they were also fixed.

* Add a .eslintignore file

The HTML coverage report is currently being linted, which causes a lot
if invalid linting errors. This change adds a ignore file to ensure these
files are properly skipped during linting.
2018-06-25 19:54:04 +02:00
Tim OramandEduardo Diaz cc61447047 Use lolex for faking date in tests (#491)
Sinon.JS provides a project called lolex to handle faking dates. This
change replaces the fakeDate utility with the equivalent Sinon.JS code.
2018-06-16 18:36:05 +02:00