Commit 2a165fe9 authored by Robert Knight's avatar Robert Knight

Convert remaining CommonJS imports in tests to ES imports

This is in preparation for switching to an ES module-oriented bundler.
parent 93e5dc6b
...@@ -21,15 +21,21 @@ ...@@ -21,15 +21,21 @@
// them as `<fixture name>.json` in this directory // them as `<fixture name>.json` in this directory
// 4. Add an entry to the fixture list below. // 4. Add an entry to the fixture list below.
import minimalDoc from './minimal.html';
import minimalJSON from './minimal.json';
import wikipediaDoc from './wikipedia-regression-testing.html';
import wikipediaJSON from './wikipedia-regression-testing.json';
export default [ export default [
{ {
name: 'Minimal Document', name: 'Minimal Document',
html: require('./minimal.html'), html: minimalDoc,
annotations: require('./minimal.json'), annotations: minimalJSON,
}, },
{ {
name: 'Wikipedia - Regression Testing', name: 'Wikipedia - Regression Testing',
html: require('./wikipedia-regression-testing.html'), html: wikipediaDoc,
annotations: require('./wikipedia-regression-testing.json'), annotations: wikipediaJSON,
}, },
]; ];
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import Guest from '../../guest'; import Guest from '../../guest';
import { $imports as guestImports } from '../../guest'; import { $imports as guestImports } from '../../guest';
import { EventBus } from '../../util/emitter'; import { EventBus } from '../../util/emitter';
import testPageHTML from './test-page.html';
function quoteSelector(quote) { function quoteSelector(quote) {
return { return {
...@@ -64,7 +65,7 @@ describe('anchoring', () => { ...@@ -64,7 +65,7 @@ describe('anchoring', () => {
beforeEach(() => { beforeEach(() => {
sinon.stub(console, 'warn'); sinon.stub(console, 'warn');
container = document.createElement('div'); container = document.createElement('div');
container.innerHTML = require('./test-page.html'); container.innerHTML = testPageHTML;
document.body.appendChild(container); document.body.appendChild(container);
const eventBus = new EventBus(); const eventBus = new EventBus();
guest = new Guest(container, eventBus); guest = new Guest(container, eventBus);
......
...@@ -11,7 +11,8 @@ import { APIService } from '../api'; ...@@ -11,7 +11,8 @@ import { APIService } from '../api';
// //
// `curl https://hypothes.is/api/ | sed 's/hypothes.is/example.com/g' | jq . > api-index.json` // `curl https://hypothes.is/api/ | sed 's/hypothes.is/example.com/g' | jq . > api-index.json`
// //
const routes = require('./api-index.json').links; import apiIndex from './api-index.json';
const routes = apiIndex.links;
describe('APIService', () => { describe('APIService', () => {
let fakeAuth; let fakeAuth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment