eslint - rules updated
This commit is contained in:
@@ -7,13 +7,13 @@ import {JSDOM} from 'jsdom';
|
||||
// @ts-ignore
|
||||
import * as rewire from 'rewire';
|
||||
|
||||
describe("frontend:index", () => {
|
||||
const updateUserName = rewire("../src/index").__get__("updateUserName") as (name: string) => void;
|
||||
describe('frontend:index', () => {
|
||||
const updateUserName = rewire('../src/index').__get__('updateUserName') as (name: string) => void;
|
||||
|
||||
beforeEach(() => {
|
||||
const dom = new JSDOM(
|
||||
`
|
||||
<html>
|
||||
<html lang="en">
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -27,13 +27,13 @@ describe("frontend:index", () => {
|
||||
global.document = dom.window.document;
|
||||
});
|
||||
|
||||
it("updateUserName", (done) => {
|
||||
const NAME = "Patrick Star";
|
||||
const RESULT = "This user name is fetched with Javascript: Patrick Star";
|
||||
it('updateUserName', (done) => {
|
||||
const NAME = 'Patrick Star';
|
||||
const RESULT = 'This user name is fetched with Javascript: Patrick Star';
|
||||
updateUserName(NAME);
|
||||
// give the browser a chance to update the DOM
|
||||
setTimeout(() => {
|
||||
const span = document.getElementsByTagName("span");
|
||||
const span = document.getElementsByTagName('span');
|
||||
expect(span).to.not.be.null;
|
||||
expect(span.length).to.be.greaterThan(0);
|
||||
expect(span[0].innerText).to.deep.equal(RESULT);
|
||||
|
||||
Reference in New Issue
Block a user