Comparing version 7.0.2 to 7.0.3
@@ -297,3 +297,7 @@ 'use strict'; | ||
token: data.token, | ||
}); | ||
}) | ||
.then((response) => { | ||
this.setCredentials(response.data.data[0]); | ||
return response; | ||
}); | ||
} | ||
@@ -300,0 +304,0 @@ |
@@ -57,3 +57,3 @@ { | ||
}, | ||
"version": "7.0.2" | ||
"version": "7.0.3" | ||
} |
@@ -498,2 +498,3 @@ 'use strict'; | ||
const config = getValidConfig(); | ||
const credentials = {}; | ||
const hp = new Halfpenny(config); | ||
@@ -504,7 +505,17 @@ const newPassword = 'the-freshest-new-password'; | ||
const spy = sinon.spy(hp, 'setCredentials'); | ||
const stub = sinon.stub(hp, 'doRequest'); | ||
// TODO: Investigate if `restore()` is actually necessary | ||
const teardown = () => { | ||
spy.restore(); | ||
stub.restore(); | ||
}; | ||
stub.returns(Promise.resolve()); | ||
stub.returns(Promise.resolve({ | ||
data: { | ||
data: [credentials], | ||
}, | ||
})); | ||
t.plan(2); | ||
t.plan(3); | ||
@@ -536,5 +547,10 @@ hp.resetPassword({ | ||
); | ||
t.equal( | ||
spy.firstCall.args[0], | ||
credentials, | ||
'saves authentication credentials' | ||
); | ||
}) | ||
.catch(t.end) | ||
.then(stub.restore, stub.restore); | ||
.then(teardown, teardown); | ||
}); | ||
@@ -541,0 +557,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52426
1478