Skip to content

Commit

Permalink
test(adapters): changed imports of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sr258 committed Jul 31, 2020
1 parent 5bfa59b commit 612e154
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
7 changes: 2 additions & 5 deletions test/adapters/ContentTypeCacheRouter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import supertest from 'supertest';

import User from '../../examples/User';
import * as H5P from '../../src';
import ContentTypeCacheExpressRouter from '../../src/adapters/ContentTypeCacheRouter/ContentTypeCacheExpressRouter';

const axiosMock = new axiosMockAdapter(axios);

Expand Down Expand Up @@ -72,11 +73,7 @@ describe('Content Type Cache endpoint adapter', () => {
req.t = (id, replacements) => id;
next();
});
app.use(
H5P.adapters.ContentTypeCacheExpressRouter(
h5pEditor.contentTypeCache
)
);
app.use(ContentTypeCacheExpressRouter(h5pEditor.contentTypeCache));
});

afterEach(async () => {
Expand Down
5 changes: 3 additions & 2 deletions test/adapters/H5PAjaxExpressRouter.configurations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { dir } from 'tmp-promise';

import User from '../../examples/User';
import * as H5P from '../../src';
import H5PAjaxExpressRouter from '../../src/adapters/H5PAjaxRouter/H5PAjaxExpressRouter';

const axiosMock = new axiosMockAdapter(axios);
interface RequestEx extends express.Request {
Expand Down Expand Up @@ -79,7 +80,7 @@ describe('Configuration of the Express Ajax endpoint adapter', () => {

it('should throw generic Express errors when then error handler is turned off in the configuration', async () => {
app.use(
H5P.adapters.express(
H5PAjaxExpressRouter(
h5pEditor,
path.resolve(path.join(tempDir, 'core')), // the path on the local disc where the files of the JavaScript client of the player are stored
path.resolve(path.join(tempDir, 'editor')), // the path on the local disc where the files of the JavaScript client of the editor are stored
Expand All @@ -95,7 +96,7 @@ describe('Configuration of the Express Ajax endpoint adapter', () => {

it('should not handle routes that are disabled in the configuration', async () => {
app.use(
H5P.adapters.express(
H5PAjaxExpressRouter(
h5pEditor,
path.resolve(path.join(tempDir, 'core')), // the path on the local disc where the files of the JavaScript client of the player are stored
path.resolve(path.join(tempDir, 'editor')), // the path on the local disc where the files of the JavaScript client of the editor are stored
Expand Down
3 changes: 2 additions & 1 deletion test/adapters/H5PAjaxExpressRouter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { dir } from 'tmp-promise';

import User from '../../examples/User';
import * as H5P from '../../src';
import H5PAjaxExpressRouter from '../../src/adapters/H5PAjaxRouter/H5PAjaxExpressRouter';

const axiosMock = new axiosMockAdapter(axios);
interface RequestEx extends express.Request {
Expand Down Expand Up @@ -69,7 +70,7 @@ describe('Express Ajax endpoint adapter', () => {
next();
});
app.use(
H5P.adapters.express(
H5PAjaxExpressRouter(
h5pEditor,
path.resolve(path.join(tempDir, 'core')), // the path on the local disc where the files of the JavaScript client of the player are stored
path.resolve(path.join(tempDir, 'editor')) // the path on the local disc where the files of the JavaScript client of the editor are stored
Expand Down
3 changes: 2 additions & 1 deletion test/adapters/LibraryAdministrationRouter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import User from '../../examples/User';
import * as H5P from '../../src';
import { ILibraryAdministrationOverviewItem } from '../../src/types';
import LibraryName from '../../src/LibraryName';
import LibraryAdministrationExpressRouter from '../../src/adapters/LibraryAdministrationRouter/LibraryAdministrationExpressRouter';

const axiosMock = new axiosMockAdapter(axios);

Expand Down Expand Up @@ -75,7 +76,7 @@ describe('Express Library Administration endpoint adapter', () => {
req.t = (id, replacements) => id;
next();
});
app.use(H5P.adapters.LibraryAdministrationExpressRouter(h5pEditor));
app.use(LibraryAdministrationExpressRouter(h5pEditor));
});

afterEach(async () => {
Expand Down

0 comments on commit 612e154

Please sign in to comment.