aboutsummaryrefslogtreecommitdiff
path: root/vnext
diff options
context:
space:
mode:
Diffstat (limited to 'vnext')
-rw-r--r--vnext/server/index.js7
-rw-r--r--vnext/server/middleware/renderer.js4
-rw-r--r--vnext/setupTests.js10
3 files changed, 11 insertions, 10 deletions
diff --git a/vnext/server/index.js b/vnext/server/index.js
index d393c4bcf..95f88cd1d 100644
--- a/vnext/server/index.js
+++ b/vnext/server/index.js
@@ -2,7 +2,8 @@ import express from 'express';
import { raw } from 'body-parser';
import cors from 'cors';
import config from 'config';
-var debug = require('debug')('http');
+import debug from 'debug';
+const log = debug('http');
// we'll talk about this in a minute:
import serverRenderer from './middleware/renderer';
@@ -11,7 +12,7 @@ import oembed from './middleware/oembed';
import urlExpand from './middleware/urlexpand';
const PORT = 8081;
-const path = require('path');
+import path from 'path';
// initialize the application and create the routes
const app = express();
@@ -42,5 +43,5 @@ app.listen(PORT, (error) => {
return console.log('something bad happened', error);
}
- debug('listening on ' + PORT + '...');
+ log('listening on ' + PORT + '...');
});
diff --git a/vnext/server/middleware/renderer.js b/vnext/server/middleware/renderer.js
index 339c04495..debba7583 100644
--- a/vnext/server/middleware/renderer.js
+++ b/vnext/server/middleware/renderer.js
@@ -9,8 +9,8 @@ import { getLinks } from '../sape';
import { StaticRouter } from 'react-router-dom/server';
import { VisitorProvider } from '../../src/ui/VisitorContext';
-const path = require('path');
-const fs = require('fs');
+import path from 'path';
+import fs from 'fs';
// convert a Unicode string to a string in which
// each 16-bit unit occupies only one byte
diff --git a/vnext/setupTests.js b/vnext/setupTests.js
index b6aaf9496..5f1e97dd8 100644
--- a/vnext/setupTests.js
+++ b/vnext/setupTests.js
@@ -4,11 +4,11 @@ window.matchMedia = window.matchMedia || function() {
return {
matches: true,
media: '',
- addListener: function() { },
- removeListener: function() { },
- addEventListener: function() { },
- removeEventListener: function() { },
+ addListener: function() { return true; },
+ removeListener: function() { return true; },
+ addEventListener: function() { return true; },
+ removeEventListener: function() { return true; },
dispatchEvent: function() { return true; },
- onchange: function() { }
+ onchange: function() { return true; }
};
};