-
Notifications
You must be signed in to change notification settings - Fork 212
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
refactor(js-client): convert fxa-js-client and its tests to commonjs #2039
Conversation
🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 🎆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the possible premature review, I'm just excited to see this! Overall looks great, there are a few questions but nothing that looks even remotely blockerish except for the failing tests.
@@ -1,9 +0,0 @@ | |||
/* This Source Code Form is subject to the terms of the Mozilla Public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing.
@@ -51,11 +52,12 @@ | |||
"grunt-open": "0.2.4", | |||
"grunt-webpack": "3.0.2", | |||
"http-proxy": "1.11.1", | |||
"intern-geezer": "2.2.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
packages/fxa-js-client/package.json
Outdated
"test": "grunt test", | ||
"test-local": "intern-client config=tests/intern auth_server=LOCAL", | ||
"test": "mocha tests/lib --reporter dot", | ||
"test-local": "AUTH_SERVER_URL=http://127.0.0.1:9000 mocha tests/lib --reporter dot", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get some failures running this command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should pass now
@vladikoff Do you have train you are targeting this for and an estimate? |
1494e82
to
bc0a2a9
Compare
bc0a2a9
to
51bb7da
Compare
fa86212
to
55ea72e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shane-tomlinson this should be good to go now
ErrorMocks.signInBlocked | ||
); | ||
}) | ||
.then(assert.notOk, function(error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is curious. assert.notOk
is not supposed to be executed is it, so did it need to change? Are the assertions below still being executed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the documentation of isNotOk
(which according to the source is just an alias for notOk
, assert.notOk
will only fail of the value passed to it is falsy. That means @philbooth is right, the error handler is not guaranteed to be called here. Any time assert.notOk
is used as the success when we do not expect it to be called should be an assert.fail
.
55ea72e
to
f7d6775
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very excited for this! The comment @philbooth made about assert.notOk
being used for the success handler is spot on. If we do not expect the success handler to be called, those need to be assert.fail
or else the error handler is not guaranteed to run.
service: 'sync', | ||
redirectTo: 'https://sync.127.0.0.1/after_reset', | ||
resume: 'resumejwt', | ||
style: 'trailhead', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All emails use "trailhead" style now, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems so!
assert.ok(resp); | ||
}, | ||
error => { | ||
console.log(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log!
ErrorMocks.signInBlocked | ||
); | ||
}) | ||
.then(assert.notOk, function(error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the documentation of isNotOk
(which according to the source is just an alias for notOk
, assert.notOk
will only fail of the value passed to it is falsy. That means @philbooth is right, the error handler is not guaranteed to be called here. Any time assert.notOk
is used as the success when we do not expect it to be called should be an assert.fail
.
* changes client structure * moves to mocha Fixes #1857
f7d6775
to
60e07b5
Compare
@shane-tomlinson updated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R...... +
Thanks for the iterations @vladikoff, this is a great change.
Fixes #1857