mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-09 07:25:21 +02:00
redundant cleared + style fixed
This commit is contained in:
parent
2ed19f6a40
commit
00d6edbc54
23 changed files with 64 additions and 114 deletions
|
@ -2,11 +2,10 @@ import fileType from 'file-type';
|
||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import nodePath from 'path';
|
import nodePath from 'path';
|
||||||
|
import config from 'config';
|
||||||
import Model, { FileData } from '../models/file';
|
import Model, { FileData } from '../models/file';
|
||||||
import crypto from '../utils/crypto';
|
import crypto from '../utils/crypto';
|
||||||
import deepMerge from '../utils/objects';
|
import deepMerge from '../utils/objects';
|
||||||
import config from 'config';
|
|
||||||
|
|
||||||
const random16 = crypto.random16;
|
const random16 = crypto.random16;
|
||||||
|
|
||||||
|
@ -107,7 +106,7 @@ class Transport {
|
||||||
const fields: string[] = path.split(':');
|
const fields: string[] = path.split(':');
|
||||||
|
|
||||||
if (fields.length > 1) {
|
if (fields.length > 1) {
|
||||||
let object = {} as Dict;
|
let object: Dict = {};
|
||||||
const result = object;
|
const result = object;
|
||||||
|
|
||||||
fields.forEach((field, i) => {
|
fields.forEach((field, i) => {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
* HttpException class for middleware
|
||||||
|
* @property {number} status - exception status code
|
||||||
|
* @property {string} message - detail about the exception
|
||||||
*/
|
*/
|
||||||
class HttpException extends Error {
|
class HttpException extends Error {
|
||||||
public status: number;
|
public status: number;
|
||||||
|
|
|
@ -32,11 +32,11 @@ interface AliasData {
|
||||||
* @property {string} id - entity title
|
* @property {string} id - entity title
|
||||||
*/
|
*/
|
||||||
class Alias {
|
class Alias {
|
||||||
public _id: string | undefined;
|
public _id?: string;
|
||||||
public hash: string | undefined;
|
public hash?: string;
|
||||||
public type: string | undefined;
|
public type?: string;
|
||||||
public deprecated: boolean | undefined;
|
public deprecated?: boolean;
|
||||||
public id: string | undefined;
|
public id?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class
|
* @class
|
||||||
|
@ -84,10 +84,6 @@ class Alias {
|
||||||
data = await aliasesDb.findOne({ hash: hash });
|
data = await aliasesDb.findOne({ hash: hash });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data instanceof Error) {
|
|
||||||
return new Alias();
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Alias(data);
|
return new Alias(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,12 @@ export interface FileData {
|
||||||
* @property {number} size - size of the file in
|
* @property {number} size - size of the file in
|
||||||
*/
|
*/
|
||||||
class File {
|
class File {
|
||||||
public _id: string | undefined;
|
public _id?: string;
|
||||||
public name: string | undefined;
|
public name?: string;
|
||||||
public filename: string | undefined;
|
public filename?: string;
|
||||||
public path: string | undefined;
|
public path?: string;
|
||||||
public mimetype: string | undefined;
|
public mimetype?: string;
|
||||||
public size: number | undefined;
|
public size?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class
|
* @class
|
||||||
|
@ -90,10 +90,6 @@ class File {
|
||||||
public static async getAll(query: object = {}): Promise<File[]> {
|
public static async getAll(query: object = {}): Promise<File[]> {
|
||||||
const docs = await filesDb.find(query);
|
const docs = await filesDb.find(query);
|
||||||
|
|
||||||
if (docs instanceof Error) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.all(docs.map(doc => new File(doc)));
|
return Promise.all(docs.map(doc => new File(doc)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ export interface PageData {
|
||||||
uri?: string;
|
uri?: string;
|
||||||
body?: any;
|
body?: any;
|
||||||
parent?: string;
|
parent?: string;
|
||||||
[key: string]: any;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,10 +62,6 @@ class Page {
|
||||||
public static async get(_id: string): Promise<Page> {
|
public static async get(_id: string): Promise<Page> {
|
||||||
const data = await pagesDb.findOne({ _id });
|
const data = await pagesDb.findOne({ _id });
|
||||||
|
|
||||||
if (data instanceof Error) {
|
|
||||||
return new Page();
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Page(data);
|
return new Page(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,10 +74,6 @@ class Page {
|
||||||
public static async getByUri(uri: string): Promise<Page> {
|
public static async getByUri(uri: string): Promise<Page> {
|
||||||
const data = await pagesDb.findOne({ uri });
|
const data = await pagesDb.findOne({ uri });
|
||||||
|
|
||||||
if (data instanceof Error) {
|
|
||||||
return new Page();
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Page(data);
|
return new Page(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,10 +86,6 @@ class Page {
|
||||||
public static async getAll(query: object = {}): Promise<Page[]> {
|
public static async getAll(query: object = {}): Promise<Page[]> {
|
||||||
const docs = await pagesDb.find(query);
|
const docs = await pagesDb.find(query);
|
||||||
|
|
||||||
if (docs instanceof Error) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.all(docs.map(doc => new Page(doc)));
|
return Promise.all(docs.map(doc => new Page(doc)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,10 +135,6 @@ class Page {
|
||||||
public async getParent(): Promise<Page|null> {
|
public async getParent(): Promise<Page|null> {
|
||||||
const data = await pagesDb.findOne({ _id: this._parent });
|
const data = await pagesDb.findOne({ _id: this._parent });
|
||||||
|
|
||||||
if (data instanceof Error) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Page(data);
|
return new Page(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,10 +146,6 @@ class Page {
|
||||||
public get children(): Promise<Page[]> {
|
public get children(): Promise<Page[]> {
|
||||||
return pagesDb.find({ parent: this._id })
|
return pagesDb.find({ parent: this._id })
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data instanceof Error) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.map(page => new Page(page));
|
return data.map(page => new Page(page));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,9 +52,9 @@ class PageOrder {
|
||||||
public static async get(pageId: string): Promise<PageOrder> {
|
public static async get(pageId: string): Promise<PageOrder> {
|
||||||
const order = await db.findOne({ page: pageId });
|
const order = await db.findOne({ page: pageId });
|
||||||
|
|
||||||
let data = {} as PageOrderData;
|
let data: PageOrderData = {};
|
||||||
|
|
||||||
if (order instanceof Error || order === null) {
|
if (order === null) {
|
||||||
data.page = pageId;
|
data.page = pageId;
|
||||||
} else {
|
} else {
|
||||||
data = order;
|
data = order;
|
||||||
|
@ -72,10 +72,6 @@ class PageOrder {
|
||||||
public static async getAll(query: object = {}): Promise<PageOrder[]> {
|
public static async getAll(query: object = {}): Promise<PageOrder[]> {
|
||||||
const docs = await db.find(query);
|
const docs = await db.find(query);
|
||||||
|
|
||||||
if (docs === null || docs instanceof Error) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.all(docs.map(doc => new PageOrder(doc)));
|
return Promise.all(docs.map(doc => new PageOrder(doc)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,9 +224,7 @@ class PageOrder {
|
||||||
if (!this._id) {
|
if (!this._id) {
|
||||||
const insertedRow = await db.insert(this.data) as { _id: string};
|
const insertedRow = await db.insert(this.data) as { _id: string};
|
||||||
|
|
||||||
if (!(insertedRow instanceof Error)) {
|
|
||||||
this._id = insertedRow._id;
|
this._id = insertedRow._id;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
await db.update({ _id: this._id }, this.data);
|
await db.update({ _id: this._id }, this.data);
|
||||||
}
|
}
|
||||||
|
@ -247,8 +241,6 @@ class PageOrder {
|
||||||
await db.remove({ _id: this._id });
|
await db.remove({ _id: this._id });
|
||||||
|
|
||||||
delete this._id;
|
delete this._id;
|
||||||
|
|
||||||
// return this;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
|
||||||
import pagesAPI from './pages';
|
import pagesAPI from './pages';
|
||||||
import transportAPI from './transport';
|
import transportAPI from './transport';
|
||||||
import linksAPI from './links';
|
import linksAPI from './links';
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
router.use('/', pagesAPI);
|
router.use('/', pagesAPI);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import express, { Request, Response } from 'express';
|
import express, { Request, Response } from 'express';
|
||||||
|
import multerFunc from 'multer';
|
||||||
import Pages from '../../controllers/pages';
|
import Pages from '../../controllers/pages';
|
||||||
import PagesOrder from '../../controllers/pagesOrder';
|
import PagesOrder from '../../controllers/pagesOrder';
|
||||||
import multerFunc from 'multer';
|
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
const multer = multerFunc();
|
const multer = multerFunc();
|
||||||
|
|
|
@ -2,9 +2,9 @@ import { Request, Response, Router } from 'express';
|
||||||
import multer, { StorageEngine } from 'multer';
|
import multer, { StorageEngine } from 'multer';
|
||||||
import mime from 'mime';
|
import mime from 'mime';
|
||||||
import mkdirp from 'mkdirp';
|
import mkdirp from 'mkdirp';
|
||||||
|
import config from 'config';
|
||||||
import Transport from '../../controllers/transport';
|
import Transport from '../../controllers/transport';
|
||||||
import { random16 } from '../../utils/crypto';
|
import { random16 } from '../../utils/crypto';
|
||||||
import config from 'config';
|
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import express, { Request, Response } from 'express';
|
import express, { Request, Response } from 'express';
|
||||||
import jwt from 'jsonwebtoken';
|
import jwt from 'jsonwebtoken';
|
||||||
import Users from '../controllers/users';
|
|
||||||
import config from 'config';
|
import config from 'config';
|
||||||
import bcrypt from 'bcrypt';
|
import bcrypt from 'bcrypt';
|
||||||
import csrf from 'csurf';
|
import csrf from 'csurf';
|
||||||
|
|
||||||
import * as dotenv from 'dotenv';
|
import * as dotenv from 'dotenv';
|
||||||
|
import Users from '../controllers/users';
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
|
||||||
import home from './home';
|
import home from './home';
|
||||||
import pages from './pages';
|
import pages from './pages';
|
||||||
import auth from './auth';
|
import auth from './auth';
|
||||||
import aliases from './aliases';
|
import aliases from './aliases';
|
||||||
import api from './api';
|
import api from './api';
|
||||||
|
|
||||||
import pagesMiddleware from './middlewares/pages';
|
import pagesMiddleware from './middlewares/pages';
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
router.use('/', pagesMiddleware, home);
|
router.use('/', pagesMiddleware, home);
|
||||||
|
|
|
@ -24,7 +24,7 @@ function createMenuTree(parentPageId: string, pages: Page[], pagesOrder: PageOrd
|
||||||
* if we got some children order on parents tree, then we push found pages in order sequence
|
* if we got some children order on parents tree, then we push found pages in order sequence
|
||||||
* otherwise just find all pages includes parent tree
|
* otherwise just find all pages includes parent tree
|
||||||
*/
|
*/
|
||||||
let ordered: any = [];
|
let ordered: any[] = [];
|
||||||
|
|
||||||
if (childrenOrder) {
|
if (childrenOrder) {
|
||||||
ordered = childrenOrder.order.map((pageId: string) => {
|
ordered = childrenOrder.order.map((pageId: string) => {
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
// import pages from './pages';
|
|
||||||
// import files from './files';
|
|
||||||
// import password from './password';
|
|
||||||
// import aliases from './aliases';
|
|
||||||
// import pagesOrder from './pagesOrder';
|
|
||||||
import Datastore from 'nedb';
|
import Datastore from 'nedb';
|
||||||
import initDb from './initDb';
|
import initDb from './initDb';
|
||||||
|
|
||||||
|
@ -19,7 +14,6 @@ interface Options {
|
||||||
returnUpdatedDocs?: boolean;
|
returnUpdatedDocs?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Database
|
* @class Database
|
||||||
* @classdesc Simple decorator class to work with nedb datastore
|
* @classdesc Simple decorator class to work with nedb datastore
|
||||||
|
|
|
@ -3,6 +3,7 @@ import config from 'config';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Init function for nedb instance
|
||||||
*
|
*
|
||||||
* @param {string} name - name of the data file
|
* @param {string} name - name of the data file
|
||||||
* @returns {Datastore} db - nedb instance
|
* @returns {Datastore} db - nedb instance
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import config from "config";
|
import config from "config";
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
|
|
||||||
import Datastore from "nedb";
|
import Datastore from "nedb";
|
||||||
|
|
||||||
import { Database } from "../src/utils/database";
|
import { Database } from "../src/utils/database";
|
||||||
|
|
||||||
interface Document {
|
interface Document {
|
||||||
|
@ -166,8 +166,7 @@ describe('Database', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// await db.update({field: {$undefinedComparator: 1}});
|
await db.update({field: {$undefinedComparator: 1}});
|
||||||
throw new Error('Unknown comparison function $undefinedComparator');
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
expect(err.message).to.equal('Unknown comparison function $undefinedComparator');
|
expect(err.message).to.equal('Unknown comparison function $undefinedComparator');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import server from "../bin/server";
|
|
||||||
import chaiHTTP from "chai-http";
|
import chaiHTTP from "chai-http";
|
||||||
import chai, { expect } from "chai";
|
import chai, { expect } from "chai";
|
||||||
|
|
||||||
|
import server from "../bin/server";
|
||||||
|
|
||||||
const app = server.app;
|
const app = server.app;
|
||||||
|
|
||||||
chai.use(chaiHTTP);
|
chai.use(chaiHTTP);
|
||||||
|
|
|
@ -53,8 +53,6 @@ describe('File model', () => {
|
||||||
|
|
||||||
file = new File(initialData);
|
file = new File(initialData);
|
||||||
|
|
||||||
// const json = file.toJSON();
|
|
||||||
|
|
||||||
data = file.data;
|
data = file.data;
|
||||||
|
|
||||||
expect(data._id).to.equal(initialData._id);
|
expect(data._id).to.equal(initialData._id);
|
||||||
|
|
|
@ -224,7 +224,12 @@ describe('Page model', () => {
|
||||||
|
|
||||||
const savedPage = await page.save();
|
const savedPage = await page.save();
|
||||||
|
|
||||||
if (savedPage._id !== undefined) {
|
if (savedPage._id == undefined) {
|
||||||
|
await page.destroy();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const foundPage = await Page.get(savedPage._id);
|
const foundPage = await Page.get(savedPage._id);
|
||||||
|
|
||||||
const {data} = foundPage;
|
const {data} = foundPage;
|
||||||
|
@ -233,7 +238,6 @@ describe('Page model', () => {
|
||||||
expect(data.title).to.equal(initialData.body.blocks[0].data.text);
|
expect(data.title).to.equal(initialData.body.blocks[0].data.text);
|
||||||
expect(data.uri).to.equal(transformToUri(initialData.body.blocks[0].data.text));
|
expect(data.uri).to.equal(transformToUri(initialData.body.blocks[0].data.text));
|
||||||
expect(data.body).to.deep.equal(initialData.body);
|
expect(data.body).to.deep.equal(initialData.body);
|
||||||
}
|
|
||||||
|
|
||||||
await page.destroy();
|
await page.destroy();
|
||||||
});
|
});
|
||||||
|
@ -311,8 +315,6 @@ describe('Page model', () => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// child.parent = parent;
|
|
||||||
|
|
||||||
const {_id: childId} = await child.save();
|
const {_id: childId} = await child.save();
|
||||||
|
|
||||||
const testedParent = await child.getParent();
|
const testedParent = await child.getParent();
|
||||||
|
@ -329,7 +331,8 @@ describe('Page model', () => {
|
||||||
|
|
||||||
expect(children.length).to.equal(1);
|
expect(children.length).to.equal(1);
|
||||||
|
|
||||||
const testedChild = children.pop() as Page;
|
const temp: Page|undefined = children.pop();
|
||||||
|
const testedChild: Page = !temp ? new Page({}) : temp;
|
||||||
|
|
||||||
expect(testedChild._id).to.equal(childId);
|
expect(testedChild._id).to.equal(childId);
|
||||||
expect(testedChild.title).to.equal(child.body.blocks[0].data.text);
|
expect(testedChild.title).to.equal(child.body.blocks[0].data.text);
|
||||||
|
@ -380,7 +383,6 @@ describe('Page model', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
order.forEach(id => {
|
order.forEach(id => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
deleteRecursively(id);
|
deleteRecursively(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -110,10 +110,9 @@ describe('PageOrder model', () => {
|
||||||
pageOrder.remove('2');
|
pageOrder.remove('2');
|
||||||
expect(pageOrder.data.order).to.deep.equals(['1', '3']);
|
expect(pageOrder.data.order).to.deep.equals(['1', '3']);
|
||||||
|
|
||||||
// Not allowed by TypeScript
|
expect(() => {
|
||||||
// expect(() => {
|
pageOrder.push(3);
|
||||||
// pageOrder.push(3);
|
}).to.throw('given id is not string');
|
||||||
// }).to.throw('given id is not string');
|
|
||||||
|
|
||||||
pageOrder.push('4');
|
pageOrder.push('4');
|
||||||
pageOrder.push('5');
|
pageOrder.push('5');
|
||||||
|
|
|
@ -1,18 +1,14 @@
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import config from "config";
|
import config from "config";
|
||||||
import rcParser from "../src/utils/rcparser";
|
|
||||||
import sinon = require('sinon');
|
import sinon = require('sinon');
|
||||||
|
|
||||||
|
import rcParser from "../src/utils/rcparser";
|
||||||
|
|
||||||
const rcPath = path.resolve(process.cwd(), config.get('rcFile'));
|
const rcPath = path.resolve(process.cwd(), config.get('rcFile'));
|
||||||
|
|
||||||
describe('RC file parser test', () => {
|
describe('RC file parser test', () => {
|
||||||
beforeEach(function () {
|
|
||||||
// spy = sinon.stub(console, 'log');
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
if (fs.existsSync(rcPath)) {
|
if (fs.existsSync(rcPath)) {
|
||||||
fs.unlinkSync(rcPath);
|
fs.unlinkSync(rcPath);
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import server from '../../bin/server';
|
|
||||||
const app = server.app;
|
|
||||||
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import config from 'config';
|
import config from 'config';
|
||||||
import chai from 'chai';
|
import chai from 'chai';
|
||||||
import chaiHTTP from 'chai-http';
|
import chaiHTTP from 'chai-http';
|
||||||
|
import server from '../../bin/server';
|
||||||
|
|
||||||
const {expect} = chai;
|
const {expect} = chai;
|
||||||
|
const app = server.app;
|
||||||
|
|
||||||
chai.use(chaiHTTP);
|
chai.use(chaiHTTP);
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
import server from '../../bin/server';
|
|
||||||
const app = server.app;
|
|
||||||
|
|
||||||
import model from '../../src/models/page';
|
|
||||||
import Page from '../../src/models/page';
|
|
||||||
import PageOrder from '../../src/models/pageOrder';
|
|
||||||
import translateString from '../../src/utils/translation';
|
|
||||||
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import config from 'config';
|
import config from 'config';
|
||||||
import chai from 'chai';
|
import chai from 'chai';
|
||||||
import chaiHTTP from 'chai-http';
|
import chaiHTTP from 'chai-http';
|
||||||
|
import server from '../../bin/server';
|
||||||
|
import model from '../../src/models/page';
|
||||||
|
import Page from '../../src/models/page';
|
||||||
|
import PageOrder from '../../src/models/pageOrder';
|
||||||
|
import translateString from '../../src/utils/translation';
|
||||||
|
|
||||||
const {expect} = chai;
|
const {expect} = chai;
|
||||||
|
const app = server.app;
|
||||||
|
|
||||||
chai.use(chaiHTTP);
|
chai.use(chaiHTTP);
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,12 @@ import fileType from 'file-type';
|
||||||
import chai from 'chai';
|
import chai from 'chai';
|
||||||
import chaiHTTP from 'chai-http';
|
import chaiHTTP from 'chai-http';
|
||||||
import rimraf from 'rimraf';
|
import rimraf from 'rimraf';
|
||||||
const {expect} = chai;
|
import config from 'config';
|
||||||
|
|
||||||
import server from '../../bin/server';
|
import server from '../../bin/server';
|
||||||
const app = server.app;
|
|
||||||
|
|
||||||
import model from '../../src/models/file';
|
import model from '../../src/models/file';
|
||||||
|
|
||||||
import config from 'config';
|
const {expect} = chai;
|
||||||
|
const app = server.app;
|
||||||
|
|
||||||
chai.use(chaiHTTP);
|
chai.use(chaiHTTP);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue