8000 Increase code coverage by daffl · Pull Request #429 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content
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
11 changes: 11 additions & 0 deletions test/application.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ describe('Feathers application', () => {
assert.equal(child.parent, app);
});

it('.use with invalid parameters', () => {
const app = feathers();

try {
app.use('/dummy', {}, {});
assert.ok(false, 'Should never get here');
} catch(e) {
assert.equal(e.message, 'invalid arg passed to app.use');
}
});

it('Register services and look them up with and without leading and trailing slashes.', () => {
const dummyService = {
find() {
Expand Down
15 changes: 15 additions & 0 deletions test/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ describe('Feathers universal client', () => {
assert.ok(typeof app.render !== 'function');
});

it('calling .use with a function throws', () => {
const app = feathers();

try {
app.use(function() {});
assert.ok(false, 'Should never get here');
} catch(e) {
assert.equal(e.message, 'Middleware functions can not be used in the Feathers client');
}
});

it('.listen does nothing', () => {
assert.deepEqual(feathers().listen(), {});
});

it('is an event emitter', done => {
const app = feathers();
const original = { hello: 'world' };
Expand Down
0