Skip to content

Commit

Permalink
chore: move cjs to mjs so standardx doesn't check it
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed May 1, 2023
1 parent 8b61045 commit fafee28
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions test/cjs-esm-compare.cjs → test/cjs-esm-compare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/* global describe, it */

import { createRequire } from 'module'
const require = createRequire(import.meta.url)
require('chai').should()

const text = `usage: git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]
Expand All @@ -15,20 +17,19 @@ const text = `usage: git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]


const cliuiCJS = require('../build/index.cjs')
import('../index.mjs').then(({ default: cliuiESM }) => {
describe('consistent wrapping', () => {
it('should produce matching output in cjs and esm', () => {
const uiCJS = cliuiCJS({})
const uiESM = cliuiESM({})
uiCJS.div({
padding: [0, 0, 0, 0],
text,
})
uiESM.div({
padding: [0, 0, 0, 0],
text,
})
uiCJS.toString().should.equal(uiESM.toString())
import cliuiESM from '../index.mjs'
describe('consistent wrapping', () => {
it('should produce matching output in cjs and esm', () => {
const uiCJS = cliuiCJS({})
const uiESM = cliuiESM({})
uiCJS.div({
padding: [0, 0, 0, 0],
text,
})
uiESM.div({
padding: [0, 0, 0, 0],
text,
})
uiCJS.toString().should.equal(uiESM.toString())
})
})

0 comments on commit fafee28

Please sign in to comment.