Adding tests, bumping packages with audit warnings
This commit is contained in:
@@ -37,4 +37,37 @@ describe('Feathers application tests', () => {
|
||||
assert.strictEqual(response?.data?.name, 'NotFound');
|
||||
}
|
||||
});
|
||||
|
||||
it('requires authentication for aliases endpoint', async () => {
|
||||
try {
|
||||
await axios.get(`${appUrl}/aliases`, {
|
||||
responseType: 'json',
|
||||
});
|
||||
assert.fail('should never get here');
|
||||
} catch (error: any) {
|
||||
const { response } = error;
|
||||
assert.strictEqual(response?.status, 401);
|
||||
assert.strictEqual(response?.data?.code, 401);
|
||||
assert.strictEqual(response?.data?.name, 'NotAuthenticated');
|
||||
}
|
||||
});
|
||||
|
||||
it('serves static files from public directory', async () => {
|
||||
const { data } = await axios.get<string>(`${appUrl}/index.html`);
|
||||
|
||||
assert.ok(data.indexOf('<html lang="en">') !== -1);
|
||||
assert.ok(data.indexOf('WildDuck') !== -1);
|
||||
});
|
||||
|
||||
it('has all services registered', () => {
|
||||
assert.ok(app.service('aliases'), 'Aliases service registered');
|
||||
assert.ok(app.service('auth-oidc'), 'Auth-OIDC service registered');
|
||||
assert.ok(app.service('auth-oidc/callback'), 'Auth-OIDC callback service registered');
|
||||
});
|
||||
|
||||
it('has correct configuration', () => {
|
||||
assert.strictEqual(typeof app.get('port'), 'number', 'Port is a number');
|
||||
assert.strictEqual(typeof app.get('host'), 'string', 'Host is a string');
|
||||
assert.strictEqual(app.get('port'), 8998, 'Port is 8998 in test mode');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user