Skip to content

Commit

Permalink
fix: improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
trygve-lie committed Jun 8, 2020
1 parent 1fed5e6 commit c3a0829
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

const Sink = class Sink {
write() {
throw new Error('Method is not implemented');
throw new Error('.write method is not implemented');
}

read() {
throw new Error('Method is not implemented');
throw new Error('.read method is not implemented');
}

delete() {
throw new Error('Method is not implemented');
throw new Error('.delete method is not implemented');
}

exist() {
throw new Error('Method is not implemented');
throw new Error('.exist method is not implemented');
}

static validateFilePath(filePath) {
Expand Down
8 changes: 4 additions & 4 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ test('Sink() - Call .write() method', (t) => {
const obj = new Sink();
t.throws(() => {
obj.write();
}, /Method is not implemented/, 'Should throw');
}, /.write method is not implemented/, 'Should throw');
t.end();
});

test('Sink() - Call .read() method', (t) => {
const obj = new Sink();
t.throws(() => {
obj.read();
}, /Method is not implemented/, 'Should throw');
}, /.read method is not implemented/, 'Should throw');
t.end();
});

test('Sink() - Call .delete() method', (t) => {
const obj = new Sink();
t.throws(() => {
obj.delete();
}, /Method is not implemented/, 'Should throw');
}, /.delete method is not implemented/, 'Should throw');
t.end();
});

test('Sink() - Call .exist() method', (t) => {
const obj = new Sink();
t.throws(() => {
obj.exist();
}, /Method is not implemented/, 'Should throw');
}, /.exist method is not implemented/, 'Should throw');
t.end();
});

Expand Down

0 comments on commit c3a0829

Please sign in to comment.