From 0287e4026fdea9281b436ad8bf96a4ffcce5e61d Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Fri, 29 May 2020 22:53:13 -0700 Subject: [PATCH] chore: tests w/ esm hook --- package.json | 3 ++- test/classnames.js | 4 ++-- test/index.js | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3ccdcb0..474e1f5 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "scripts": { "build": "bundt", "pretest": "npm run build", - "test": "tape test/*.js | tap-spec" + "test": "tape -r esm test/*.js | tap-spec" }, "files": [ "*.d.ts", @@ -32,6 +32,7 @@ ], "devDependencies": { "bundt": "1.0.1", + "esm": "3.2.25", "tap-spec": "5.0.0", "tape": "4.9.1" } diff --git a/test/classnames.js b/test/classnames.js index 551e3bc..68c3b02 100644 --- a/test/classnames.js +++ b/test/classnames.js @@ -2,8 +2,8 @@ * Ported from `classnames` for compatibility checks. */ -const test = require('tape'); -const fn = require('../dist/clsx'); +import test from 'tape'; +import fn from '../src'; test('(compat) keeps object keys with truthy values', t => { const out = fn({ a:true, b:false, c:0, d:null, e:undefined, f:1 }); diff --git a/test/index.js b/test/index.js index 798453e..b4e6b2f 100644 --- a/test/index.js +++ b/test/index.js @@ -1,5 +1,5 @@ -const test = require('tape'); -const fn = require('../dist/clsx'); +import test from 'tape'; +import fn from '../src'; test('clsx', t => { t.is(typeof fn, 'function', 'exports a function');