Skip to content

Commit

Permalink
fix(test): improperly handled async test
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamann committed Jul 6, 2021
1 parent 6fcef3e commit dc40b01
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/stores/file-store.test.js
Expand Up @@ -268,13 +268,18 @@ describe('nconf/stores/file', () => {
secure: 'super-secretzzz'
});

it("the load() method should decrypt legacy file properly", () => {
it("the load() method should throw an error when presented a legacy encrypted file", (done) => {
secureStore.load(function (err, loaded) {
expect(err).toBe(null);
expect(loaded).toEqual(data);
try {
expect(err).not.toBe(null);
expect(loaded).toEqual(void 0);
done();
} catch (err) {
done(err);
}
});
});
it("the loadSync() method should throw an error with a legacy encrypted file", () => {
it("the loadSync() method should throw an error when presented a legacy encrypted file", () => {
expect(() => {
secureStore.loadSync();
}).toThrow();
Expand Down

0 comments on commit dc40b01

Please sign in to comment.