Skip to content

Commit

Permalink
add failing tests from evanw/esbuild#2001
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Feb 9, 2022
1 parent 8e9ae59 commit 0321716
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 5 deletions.
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,42 @@ node_modules/pkg/lib/fail.js:
<td>✅</td>
<td>🚫</td>
</tr>
<tr><td><pre>/entry.js:
require('pkg/sub')
/node_modules/pkg/package.json:
{ "browser": { "./sub": "./sub/index.js" } }
/node_modules/pkg/sub/index.js:
require('sub')
/node_modules/sub/index.js:
input.works = true
</pre></td>
<td>🚫</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
</tr>
<tr><td><pre>/entry.js:
require('pkg/sub')
/node_modules/pkg/package.json:
{ "browser": { "./sub": "./sub/index.js" } }
/node_modules/pkg/sub/index.js:
require('sub2')
/node_modules/sub2/index.js:
input.works = true
</pre></td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
<td>✅</td>
</tr>
<tr><td>Percent handled:</td>
<td>100.0%</td>
<td>79.2%</td>
<td>66.7%</td>
<td>62.5%</td>
<td>25.0%</td>
<td>96.2%</td>
<td>80.8%</td>
<td>69.2%</td>
<td>65.4%</td>
<td>30.8%</td>
</tr>
</table>

Expand Down
13 changes: 13 additions & 0 deletions tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ const positiveTests = [
'node_modules/pkg/lib/index.js': `input.works = true`,
'node_modules/pkg/lib/fail.js': `throw 'fail'`,
},
{
"/entry.js": `require('pkg/sub')`,
"/node_modules/pkg/package.json": `{ "browser": { "./sub": "./sub/index.js" } }`,
"/node_modules/pkg/sub/index.js": `require('sub')`,
"/node_modules/sub/index.js": `input.works = true`,
},
{

"/entry.js": `require('pkg/sub')`,
"/node_modules/pkg/package.json": `{ "browser": { "./sub": "./sub/index.js" } }`,
"/node_modules/pkg/sub/index.js": `require('sub2')`,
"/node_modules/sub2/index.js": `input.works = true`,
},
]

const negativeTests = [
Expand Down

0 comments on commit 0321716

Please sign in to comment.