-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from dcastil/feature/96/add-test-for-package-…
…exports Add tests to check actual CJS and ESM package exports
- Loading branch information
Showing
6 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ jobs: | |
name: build-output | ||
path: dist | ||
if-no-files-found: error | ||
- run: yarn test:exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const assert = require('assert') | ||
|
||
const { twMerge } = require('..') | ||
|
||
assert(twMerge() === '') | ||
assert( | ||
twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]') === | ||
'hover:bg-dark-red p-3 bg-[#B91C1C]' | ||
) | ||
|
||
console.log('[tailwind-merge] Tests for built CJS package exports passed.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import assert from 'assert' | ||
|
||
// Not ideal, but there seems to be no way to point the import resolver to the package.json file if this isn't a npm package. | ||
import { twMerge } from '../dist/tailwind-merge.mjs' | ||
|
||
assert(twMerge() === '') | ||
assert( | ||
twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]') === | ||
'hover:bg-dark-red p-3 bg-[#B91C1C]' | ||
) | ||
|
||
console.log('[tailwind-merge] Tests for built ESM package exports passed.') |