Skip to content

Commit 5c76fde

Browse files
committed
change tests to mjs
this is necessary as Chai@v5 has moved to ESM only see #498 (comment)
1 parent 95f1845 commit 5c76fde

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

tests/utils/get-element-type.js renamed to tests/utils/get-element-type.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const {getElementType} = require('../../lib/utils/get-element-type')
2-
const {mockJSXAttribute, mockJSXConditionalAttribute, mockJSXOpeningElement} = require('./mocks')
1+
import {expect} from 'chai'
2+
import {getElementType} from '../../lib/utils/get-element-type'
3+
import {mockJSXAttribute, mockJSXConditionalAttribute, mockJSXOpeningElement} from './mocks'
34

45
const mocha = require('mocha')
56
const describe = mocha.describe
67
const it = mocha.it
7-
const expect = require('chai').expect
88

99
function mockSetting(componentSetting = {}) {
1010
return {

tests/utils/get-role.js renamed to tests/utils/get-role.mjs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
const {getRole} = require('../../lib/utils/get-role')
2-
const {mockJSXAttribute, mockJSXConditionalAttribute, mockJSXOpeningElement} = require('./mocks')
3-
const mocha = require('mocha')
4-
const describe = mocha.describe
5-
const it = mocha.it
6-
const expect = require('chai').expect
1+
import {expect} from 'chai'
2+
import {getRole} from '../../lib/utils/get-role'
3+
import {mockJSXAttribute, mockJSXConditionalAttribute, mockJSXOpeningElement} from './mocks'
4+
import {describe, it} from 'mocha'
75

86
describe('getRole', function () {
97
it('returns undefined when polymorphic prop is set with a non-literal expression', function () {

tests/utils/object-map.js renamed to tests/utils/object-map.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
2-
const ObjectMap = require('../../lib/utils/object-map')
3-
const {describe, it} = require('mocha')
4-
const expect = require('chai').expect
2+
import {expect} from 'chai'
3+
import ObjectMap from '../../lib/utils/object-map'
4+
import {describe, it} from 'mocha'
55

66
describe('ObjectMap', function () {
77
it('constructs an ObjectMap', function () {

0 commit comments

Comments
 (0)