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 @@
// them as `<fixture name>.json` in this directory
// 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 [
{
name: 'Minimal Document',
html: require('./minimal.html'),
annotations: require('./minimal.json'),
html: minimalDoc,
annotations: minimalJSON,
},
{
name: 'Wikipedia - Regression Testing',
html: require('./wikipedia-regression-testing.html'),
annotations: require('./wikipedia-regression-testing.json'),
html: wikipediaDoc,
annotations: wikipediaJSON,
},
];
......@@ -4,6 +4,7 @@
import Guest from '../../guest';
import { $imports as guestImports } from '../../guest';
import { EventBus } from '../../util/emitter';
import testPageHTML from './test-page.html';
function quoteSelector(quote) {
return {
......@@ -64,7 +65,7 @@ describe('anchoring', () => {
beforeEach(() => {
sinon.stub(console, 'warn');
container = document.createElement('div');
container.innerHTML = require('./test-page.html');
container.innerHTML = testPageHTML;
document.body.appendChild(container);
const eventBus = new EventBus();
guest = new Guest(container, eventBus);
......
......@@ -11,7 +11,8 @@ import { APIService } from '../api';
//
// `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', () => {
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