add prettier
This commit is contained in:
@@ -1,40 +1,40 @@
|
||||
// For more information about this file see https://dove.feathersjs.com/guides/cli/app.test.html
|
||||
import assert from "assert";
|
||||
import axios from "axios";
|
||||
import type { Server } from "http";
|
||||
import { app } from "../src/app";
|
||||
import assert from 'assert';
|
||||
import axios from 'axios';
|
||||
import type { Server } from 'http';
|
||||
import { app } from '../src/app';
|
||||
|
||||
const port = app.get("port");
|
||||
const appUrl = `http://${app.get("host")}:${port}`;
|
||||
const port = app.get('port');
|
||||
const appUrl = `http://${app.get('host')}:${port}`;
|
||||
|
||||
describe("Feathers application tests", () => {
|
||||
let server: Server;
|
||||
describe('Feathers application tests', () => {
|
||||
let server: Server;
|
||||
|
||||
before(async () => {
|
||||
server = await app.listen(port);
|
||||
});
|
||||
before(async () => {
|
||||
server = await app.listen(port);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await app.teardown();
|
||||
});
|
||||
after(async () => {
|
||||
await app.teardown();
|
||||
});
|
||||
|
||||
it("starts and shows the index page", async () => {
|
||||
const { data } = await axios.get<string>(appUrl);
|
||||
it('starts and shows the index page', async () => {
|
||||
const { data } = await axios.get<string>(appUrl);
|
||||
|
||||
assert.ok(data.indexOf('<html lang="en">') !== -1);
|
||||
});
|
||||
assert.ok(data.indexOf('<html lang="en">') !== -1);
|
||||
});
|
||||
|
||||
it("shows a 404 JSON error", async () => {
|
||||
try {
|
||||
await axios.get(`${appUrl}/path/to/nowhere`, {
|
||||
responseType: "json",
|
||||
});
|
||||
assert.fail("should never get here");
|
||||
} catch (error: any) {
|
||||
const { response } = error;
|
||||
assert.strictEqual(response?.status, 404);
|
||||
assert.strictEqual(response?.data?.code, 404);
|
||||
assert.strictEqual(response?.data?.name, "NotFound");
|
||||
}
|
||||
});
|
||||
it('shows a 404 JSON error', async () => {
|
||||
try {
|
||||
await axios.get(`${appUrl}/path/to/nowhere`, {
|
||||
responseType: 'json',
|
||||
});
|
||||
assert.fail('should never get here');
|
||||
} catch (error: any) {
|
||||
const { response } = error;
|
||||
assert.strictEqual(response?.status, 404);
|
||||
assert.strictEqual(response?.data?.code, 404);
|
||||
assert.strictEqual(response?.data?.name, 'NotFound');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@@ -1,11 +1,11 @@
|
||||
// For more information about this file see https://dove.feathersjs.com/guides/cli/service.test.html
|
||||
import assert from "assert";
|
||||
import { app } from "../../../src/app";
|
||||
import assert from 'assert';
|
||||
import { app } from '../../../src/app';
|
||||
|
||||
describe("aliases service", () => {
|
||||
it("registered the service", () => {
|
||||
const service = app.service("aliases");
|
||||
describe('aliases service', () => {
|
||||
it('registered the service', () => {
|
||||
const service = app.service('aliases');
|
||||
|
||||
assert.ok(service, "Registered the service");
|
||||
});
|
||||
assert.ok(service, 'Registered the service');
|
||||
});
|
||||
});
|
||||
|
@@ -1,11 +1,11 @@
|
||||
// For more information about this file see https://dove.feathersjs.com/guides/cli/service.test.html
|
||||
import assert from "assert";
|
||||
import { app } from "../../../src/app";
|
||||
import assert from 'assert';
|
||||
import { app } from '../../../src/app';
|
||||
|
||||
describe("auth-oidc service", () => {
|
||||
it("registered the service", () => {
|
||||
const service = app.service("auth-oidc");
|
||||
describe('auth-oidc service', () => {
|
||||
it('registered the service', () => {
|
||||
const service = app.service('auth-oidc');
|
||||
|
||||
assert.ok(service, "Registered the service");
|
||||
});
|
||||
assert.ok(service, 'Registered the service');
|
||||
});
|
||||
});
|
||||
|
@@ -1,11 +1,11 @@
|
||||
// For more information about this file see https://dove.feathersjs.com/guides/cli/service.test.html
|
||||
import assert from "assert";
|
||||
import { app } from "../../../../src/app";
|
||||
import assert from 'assert';
|
||||
import { app } from '../../../../src/app';
|
||||
|
||||
describe("auth-oidc/callback service", () => {
|
||||
it("registered the service", () => {
|
||||
const service = app.service("auth-oidc/callback");
|
||||
describe('auth-oidc/callback service', () => {
|
||||
it('registered the service', () => {
|
||||
const service = app.service('auth-oidc/callback');
|
||||
|
||||
assert.ok(service, "Registered the service");
|
||||
});
|
||||
assert.ok(service, 'Registered the service');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user