Skip to content

Commit

Permalink
test(mocha): fix running tests on Node.js >= 16
Browse files Browse the repository at this point in the history
The Node.js thread of mocha test got stuck after running it.

Refs #2710
  • Loading branch information
char0n committed Nov 3, 2021
1 parent 69cf743 commit 0fd72d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 1 addition & 5 deletions test/mocha/plugins/editor/editor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import expect, { createSpy } from "expect"
import rewiremock from "rewiremock"
import Enzyme, { shallow } from "enzyme"
import Adapter from "@wojtekmaj/enzyme-adapter-react-17"
import { shallow } from "enzyme"
import React from "react"
import FakeAce from "test/mocha/mocks/ace.js"
import { fromJS } from "immutable"
Expand All @@ -23,9 +22,6 @@ const EVENTUALLY = 900 // ms

describe("editor", function () {
before(function () {
// Enzyme.configure({ adapter: new Adapter()})
Enzyme.configure({ adapter: new Adapter() })

// Whole bunch of mocks!
rewiremock.enable()
rewiremock("brace/mode/yaml").with({})
Expand Down
5 changes: 5 additions & 0 deletions test/mocha/setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const Enzyme = require("enzyme")
const Adapter = require("@wojtekmaj/enzyme-adapter-react-17")

Enzyme.configure({ adapter: new Adapter() })

if (typeof process === "object") {
require("jsdom-global")()
}

0 comments on commit 0fd72d5

Please sign in to comment.