Skip to content

Commit

Permalink
change tests to mjs
Browse files Browse the repository at this point in the history
this is necessary as Chai@v5 has moved to ESM only see #498 (comment)
  • Loading branch information
theinterned committed Jan 5, 2024
1 parent 95f1845 commit 5c76fde
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
@@ -1,10 +1,10 @@
const {getElementType} = require('../../lib/utils/get-element-type')
const {mockJSXAttribute, mockJSXConditionalAttribute, mockJSXOpeningElement} = require('./mocks')
import {expect} from 'chai'
import {getElementType} from '../../lib/utils/get-element-type'
import {mockJSXAttribute, mockJSXConditionalAttribute, mockJSXOpeningElement} from './mocks'

const mocha = require('mocha')
const describe = mocha.describe
const it = mocha.it
const expect = require('chai').expect

function mockSetting(componentSetting = {}) {
return {
Expand Down
10 changes: 4 additions & 6 deletions tests/utils/get-role.js → tests/utils/get-role.mjs
@@ -1,9 +1,7 @@
const {getRole} = require('../../lib/utils/get-role')
const {mockJSXAttribute, mockJSXConditionalAttribute, mockJSXOpeningElement} = require('./mocks')
const mocha = require('mocha')
const describe = mocha.describe
const it = mocha.it
const expect = require('chai').expect
import {expect} from 'chai'
import {getRole} from '../../lib/utils/get-role'
import {mockJSXAttribute, mockJSXConditionalAttribute, mockJSXOpeningElement} from './mocks'
import {describe, it} from 'mocha'

describe('getRole', function () {
it('returns undefined when polymorphic prop is set with a non-literal expression', function () {
Expand Down
6 changes: 3 additions & 3 deletions tests/utils/object-map.js → tests/utils/object-map.mjs
@@ -1,7 +1,7 @@
// @ts-check
const ObjectMap = require('../../lib/utils/object-map')
const {describe, it} = require('mocha')
const expect = require('chai').expect
import {expect} from 'chai'
import ObjectMap from '../../lib/utils/object-map'
import {describe, it} from 'mocha'

describe('ObjectMap', function () {
it('constructs an ObjectMap', function () {
Expand Down

0 comments on commit 5c76fde

Please sign in to comment.