From fafee28a1e36415519023c551591514780a62c69 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sun, 30 Apr 2023 19:36:37 -0700 Subject: [PATCH] chore: move cjs to mjs so standardx doesn't check it --- ...js-esm-compare.cjs => cjs-esm-compare.mjs} | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) rename test/{cjs-esm-compare.cjs => cjs-esm-compare.mjs} (58%) diff --git a/test/cjs-esm-compare.cjs b/test/cjs-esm-compare.mjs similarity index 58% rename from test/cjs-esm-compare.cjs rename to test/cjs-esm-compare.mjs index d42506f..090db95 100644 --- a/test/cjs-esm-compare.cjs +++ b/test/cjs-esm-compare.mjs @@ -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 ] [-f] [-m | -F ] [-e] @@ -15,20 +17,19 @@ const text = `usage: git tag [-a | -s | -u ] [-f] [-m | -F ] 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()) }) })