mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 01:22:54 +00:00
feat: migrate to esm
This commit is contained in:
@@ -22,8 +22,8 @@ import {
|
||||
} from '@openstapps/core';
|
||||
import {expect} from 'chai';
|
||||
import {instance as book} from '@openstapps/core/test/resources/indexable/Book.1.json';
|
||||
import {bulk, DEFAULT_TEST_TIMEOUT} from '../common';
|
||||
import {testApp} from '../tests-setup';
|
||||
import {bulk, DEFAULT_TEST_TIMEOUT} from '../common.js';
|
||||
import {testApp} from '../tests-setup.js';
|
||||
|
||||
describe('Bulk routes', async function () {
|
||||
// increase timeout for the suite
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import {SCRouteHttpVerbs} from '@openstapps/core';
|
||||
import {expect} from 'chai';
|
||||
import {isHttpMethod} from '../../src/routes/http-types';
|
||||
import {isHttpMethod} from '../../src/routes/http-types.js';
|
||||
|
||||
describe('Is HTTP method', async function () {
|
||||
it('should allow valid (predefined) http methods', async function () {
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {DEFAULT_TEST_TIMEOUT} from '../common';
|
||||
import {testApp} from '../tests-setup';
|
||||
import {DEFAULT_TEST_TIMEOUT} from '../common.js';
|
||||
import {testApp} from '../tests-setup.js';
|
||||
import {SCIndexRequest, SCIndexRoute} from '@openstapps/core';
|
||||
import {expect} from 'chai';
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@ import {
|
||||
SCValidationErrorResponse,
|
||||
} from '@openstapps/core';
|
||||
import nock from 'nock';
|
||||
import {configFile, plugins} from '../../src/common';
|
||||
import {pluginRegisterHandler} from '../../src/routes/plugin-register-route';
|
||||
import {configFile, plugins} from '../../src/common.js';
|
||||
import {pluginRegisterHandler} from '../../src/routes/plugin-register-route.js';
|
||||
import {expect, use} from 'chai';
|
||||
import chaiAsPromised from 'chai-as-promised';
|
||||
import {instance as registerRequest} from '@openstapps/core/test/resources/PluginRegisterRequest.1.json';
|
||||
import {DEFAULT_TEST_TIMEOUT} from '../common';
|
||||
import {testApp} from '../tests-setup';
|
||||
import {DEFAULT_TEST_TIMEOUT} from '../common.js';
|
||||
import {testApp} from '../tests-setup.js';
|
||||
|
||||
// for using promises in expectations (to.eventually.be...)
|
||||
use(chaiAsPromised);
|
||||
|
||||
@@ -25,12 +25,12 @@ import * as bodyParser from 'body-parser';
|
||||
import sinon from 'sinon';
|
||||
import {expect} from 'chai';
|
||||
import {Application} from 'express';
|
||||
import {validator} from '../../src/common';
|
||||
import {createRoute} from '../../src/routes/route';
|
||||
import {validator} from '../../src/common.js';
|
||||
import {createRoute} from '../../src/routes/route.js';
|
||||
import express, {Express} from 'express';
|
||||
import supertest from 'supertest';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {DEFAULT_TEST_TIMEOUT} from '../common';
|
||||
import {DEFAULT_TEST_TIMEOUT} from '../common.js';
|
||||
|
||||
interface ReturnType {
|
||||
foo: boolean;
|
||||
|
||||
@@ -21,9 +21,9 @@ import {
|
||||
SCTooManyRequestsErrorResponse,
|
||||
} from '@openstapps/core';
|
||||
import {expect} from 'chai';
|
||||
import {configFile} from '../../src/common';
|
||||
import {DEFAULT_TEST_TIMEOUT} from '../common';
|
||||
import {testApp} from '../tests-setup';
|
||||
import {configFile} from '../../src/common.js';
|
||||
import {DEFAULT_TEST_TIMEOUT} from '../common.js';
|
||||
import {testApp} from '../tests-setup.js';
|
||||
import sinon from 'sinon';
|
||||
|
||||
describe('Search route', async function () {
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
import {SCThingUpdateRoute} from '@openstapps/core';
|
||||
import chaiAsPromised from 'chai-as-promised';
|
||||
import {bulkStorageMock, DEFAULT_TEST_TIMEOUT} from '../common';
|
||||
import {bulkStorageMock, DEFAULT_TEST_TIMEOUT} from '../common.js';
|
||||
import {expect, use} from 'chai';
|
||||
import {instance as book} from '@openstapps/core/test/resources/indexable/Book.1.json';
|
||||
import {testApp} from '../tests-setup';
|
||||
import {testApp} from '../tests-setup.js';
|
||||
|
||||
use(chaiAsPromised);
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@ import got, {Options} from 'got';
|
||||
import nock from 'nock';
|
||||
import sinon from 'sinon';
|
||||
import {mockReq} from 'sinon-express-mock';
|
||||
import {plugins, validator} from '../../src/common';
|
||||
import {virtualPluginRoute} from '../../src/routes/virtual-plugin-route';
|
||||
import {DEFAULT_TEST_TIMEOUT, FooError} from '../common';
|
||||
import {plugins, validator} from '../../src/common.js';
|
||||
import {virtualPluginRoute} from '../../src/routes/virtual-plugin-route.js';
|
||||
import {DEFAULT_TEST_TIMEOUT, FooError} from '../common.js';
|
||||
import {registerAddRequest} from './plugin-register-route.spec';
|
||||
import {testApp} from '../tests-setup';
|
||||
import {testApp} from '../tests-setup.js';
|
||||
|
||||
use(chaiAsPromised);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user