Skip to content

Commit

Permalink
tests: ES6 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nleush committed Oct 14, 2021
1 parent 29bc742 commit 0ee79cf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
11 changes: 6 additions & 5 deletions test/core-plugins.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
var assert = require('chai').assert
import { assert as assert } from 'chai'

global.CONFIG = require('../config');
import config from '../config';
global.CONFIG = config;

var iframely = require('../lib/core').getPluginData;
var findWhitelistRecordFor = require('../lib/whitelist').findWhitelistRecordFor;
var utils = require('../lib/utils');
import { getPluginData as iframely } from '../lib/core';
import { findWhitelistRecordFor as findWhitelistRecordFor } from '../lib/whitelist';
import * as utils from '../lib/utils.js';

function assertOembed(oembed) {
assert.isObject(oembed);
Expand Down
11 changes: 5 additions & 6 deletions test/custom_plugins.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use strict';

var request = require('supertest');
var ServerMock = require('mock-http-server');
var chai = require('chai');
var async = require('async');
import * as request from 'supertest';
import * as ServerMock from 'mock-http-server';
import * as chai from 'chai';
import * as async from 'async';

var server;

Expand All @@ -15,7 +14,7 @@ function invalidateRequireCache () {

var startWithENV = function (env, cb) {
process.env.NODE_ENV = env;
var app = require('../app');
import * as app from '../app.js';
server = app.listen(process.env.PORT, cb);
};

Expand Down
11 changes: 5 additions & 6 deletions test/e2e.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use strict';

var request = require('supertest');
var ServerMock = require('mock-http-server');
var chai = require('chai');
var async = require('async');
import * as request from 'supertest';
import * as ServerMock from 'mock-http-server';
import * as chai from 'chai';
import * as async from 'async';

describe('meta endpoint', function() {

Expand All @@ -16,7 +15,7 @@ describe('meta endpoint', function() {
var server;

beforeEach(function(done) {
var app = require('../app');
import * as app from '../app.js';
server = app.listen(process.env.PORT, function() {
targetMockedServer.start(done);
});
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/custom-plugins/domains/test.com.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
var utils = require('../../../../utils');

module.exports = {
export default {

re: /testok/i,

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/custom-plugins/meta/html-title.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {

getMeta: function(meta) {
return {
Expand Down

0 comments on commit 0ee79cf

Please sign in to comment.