Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"nock": "8.0.0",
"npmshrink": "1.0.1",
"nyc": "13.0.0",
"proxyquire": "1.8.0",
"proxyquire": "2.0.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purely for my own curiosity, are there any cool new features/fixes we're getting with this upgrade or is it just to get us on the latest and greatest generally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this upgrade just had bug fixes. I thought they might resolve some of the flaky test but didn't.

"simplesmtp": "0.3.35",
"sinon": "1.17.5",
"sjcl": "1.0.6",
Expand Down
2 changes: 1 addition & 1 deletion scripts/mocha-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const MOCHA_BIN = path.join(path.dirname(__dirname), 'node_modules', '.bin', 'mo
const NYC_BIN = path.join(path.dirname(__dirname), 'node_modules', '.bin', 'nyc')

let bin = NYC_BIN
let argv = ['--cache', MOCHA_BIN]
let argv = ['--cache', '--no-clean', MOCHA_BIN]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? (purely for my own curiosity, again)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --no-clean does not remove coverage files from previous runs. Since I split the test runs, it generates the coverage data as if it was run in one operation.


if (process.env.NO_COVERAGE) {
bin = MOCHA_BIN
Expand Down
18 changes: 12 additions & 6 deletions scripts/test-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ if [ -z "$CORS_ORIGIN" ]; then export CORS_ORIGIN="http://foo,http://bar"; fi;

set -u

GLOB=$*
if [ -z "$GLOB" ]; then
GLOB="test/local test/remote"
fi

DEFAULT_ARGS="-R dot --recursive --timeout 5000 --exit"

./scripts/gen_keys.js
./scripts/gen_vapid_keys.js
./scripts/mocha-coverage.js $DEFAULT_ARGS $GLOB

GLOB=$*
if [ -z "$GLOB" ]; then
echo "Local tests"
./scripts/mocha-coverage.js $DEFAULT_ARGS test/local

echo "Remote tests"
./scripts/mocha-coverage.js $DEFAULT_ARGS test/remote
else
./scripts/mocha-coverage.js $DEFAULT_ARGS $GLOB
fi

grunt eslint copyright
18 changes: 7 additions & 11 deletions test/remote/db_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,15 +683,13 @@ describe('remote db', function() {
.then(function(passwordForgotToken) {
return db.forgotPasswordVerified(passwordForgotToken)
.then(accountResetToken => {
assert.ok(accountResetToken.createdAt > passwordForgotToken.createdAt, 'account reset token should be newer than password forgot token')
assert.ok(accountResetToken.createdAt >= passwordForgotToken.createdAt, 'account reset token should be equal or newer than password forgot token')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes #2534 (comment), where I think the reset token has the same timestamp as forgot token since it gets create right next to each other. I could have added a delay here but opted to just test that they were >= since a they could have same timestamp.

return accountResetToken
})
})
.then(function(accountResetToken) {
assert.deepEqual(accountResetToken.uid, account.uid, 'account reset token uid should be the same as the account.uid')
tokenId = accountResetToken.id
})
.then(function() {
return db.accountResetToken(tokenId)
})
.then(function(accountResetToken) {
Expand All @@ -702,15 +700,13 @@ describe('remote db', function() {
.then(function(accountResetToken) {
return db.deleteAccountResetToken(accountResetToken)
})
.then(function() {
.then(function () {
return db.accountResetToken(tokenId)
})
.then(function(accountResetToken) {
assert(false, 'The above accountResetToken() call should fail, since the accountResetToken has been deleted')
}, function(err) {
assert.equal(err.errno, 110, 'accountResetToken() fails with the correct error code')
var msg = 'Error: The authentication token could not be found'
assert.equal(msg, '' + err, 'accountResetToken() fails with the correct message')
.then(assert.fail, function (err) {
assert.equal(err.errno, 110, 'accountResetToken() fails with the correct error code')
var msg = 'Error: The authentication token could not be found'
assert.equal(msg, '' + err, 'accountResetToken() fails with the correct message')
})
})
}
)
Expand Down