Skip to content

Commit

Permalink
fix config test
Browse files Browse the repository at this point in the history
the cases weren't including ./package.json which is also added
as an export, if available.
  • Loading branch information
isaacs committed May 9, 2024
1 parent af590bd commit d012c74
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions test/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import t from 'tap'
import { Package, TshyConfig, TshyConfigMaybeGlobExports } from '../src/types.js'
import {
Package,
TshyConfig,
TshyConfigMaybeGlobExports,
} from '../src/types.js'

const cases: [
config: undefined | TshyConfigMaybeGlobExports,
Expand All @@ -18,28 +22,42 @@ const cases: [
{ exports: './src/*' },
['./src/index.ts', './src/foo.ts', './src/utils/bar.ts'],
true,
{ exports: {
'.': './src/index.ts',
'./foo': './src/foo.ts',
}},
{
exports: {
'./package.json': './package.json',
'.': './src/index.ts',
'./foo': './src/foo.ts',
},
},
],
[
{ exports: 'src/*' },
['./src/index.ts', './src/foo.ts', './src/utils/bar.ts'],
true,
{ exports: {
'.': './src/index.ts',
'./foo': './src/foo.ts',
}},
{
exports: {
'./package.json': './package.json',
'.': './src/index.ts',
'./foo': './src/foo.ts',
},
},
],
[
{ exports: ['src/utils/*.ts', './src/index.*'] },
['./src/index.ts', './src/utils/baz.js', './src/foo.ts', './src/utils/bar.ts'],
[
'./src/index.ts',
'./src/utils/baz.js',
'./src/foo.ts',
'./src/utils/bar.ts',
],
true,
{ exports: {
'.': './src/index.ts',
'./utils/bar': './src/utils/bar.ts',
}},
{
exports: {
'./package.json': './package.json',
'.': './src/index.ts',
'./utils/bar': './src/utils/bar.ts',
},
},
],

[
Expand Down

0 comments on commit d012c74

Please sign in to comment.