Skip to content

Commit

Permalink
Test require.addon() with __filename as referrer
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Nov 30, 2024
1 parent c7c8da4 commit a4baa84
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,34 @@ test('require.addon("id")', (t) => {
})
})

test("require.addon('id', __filename)", (t) => {
t.alike(lex("require.addon('./foo.bare', __filename)"), {
imports: [
{
specifier: './foo.bare',
type: REQUIRE | ADDON,
names: [],
position: [0, 15, 25]
}
],
exports: []
})
})

test('require.addon("id", __filename)', (t) => {
t.alike(lex('require.addon("./foo.bare", __filename)'), {
imports: [
{
specifier: './foo.bare',
type: REQUIRE | ADDON,
names: [],
position: [0, 15, 25]
}
],
exports: []
})
})

test('require.addon.resolve()', (t) => {
t.alike(lex('require.addon.resolve()'), {
imports: [
Expand Down

0 comments on commit a4baa84

Please sign in to comment.