-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
225 additions
and
32 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ out | |
coverage | ||
test/**/dist | ||
test/**/actual.js | ||
test/unit/cjs-querystring/who?what?idk!.js |
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
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,7 @@ | ||
// Test that CJS files treat question marks in filenames as any other character, | ||
// matching Node behavior | ||
|
||
// https://www.youtube.com/watch?v=2ve20PVNZ18 | ||
|
||
const baseball = require('./who?what?idk!'); | ||
console.log(baseball.players); |
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 @@ | ||
module.exports = { | ||
players: { | ||
first: 'Who', | ||
second: 'What', | ||
third: "I Don't Know", | ||
left: 'Why', | ||
center: 'Because', | ||
pitcher: 'Tomorrow', | ||
catcher: 'Today', | ||
shortstop: "I Don't Give a Damn!", | ||
}, | ||
}; |
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,5 @@ | ||
[ | ||
"package.json", | ||
"test/unit/cjs-querystring/input.js", | ||
"test/unit/cjs-querystring/who?what?idk!.js" | ||
] |
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,4 @@ | ||
import { numSpecies } from "./bear.mjs?beaver?bison"; | ||
console.log(`There are ${numSpecies} species of bears.`); | ||
|
||
export const food = "termites"; |
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,4 @@ | ||
import * as cheetah from "./cheetah.mjs?cow=chipmunk"; | ||
console.log(`Cheetahs can run ${cheetah.topSpeed} mph.`); | ||
|
||
export const numSpecies = 8; |
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 @@ | ||
export const topSpeed = 65; |
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,6 @@ | ||
// Test that querystrings of various forms get stripped from esm imports when those | ||
// imports contain the `.mjs` file extension | ||
|
||
import * as aardvark from "./animalFacts/aardvark.mjs?anteater"; | ||
|
||
console.log(`Aardvarks eat ${aardvark.food}.`); |
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,7 @@ | ||
[ | ||
"test/unit/esm-querystring-mjs/animalFacts/aardvark.mjs", | ||
"test/unit/esm-querystring-mjs/animalFacts/bear.mjs", | ||
"test/unit/esm-querystring-mjs/animalFacts/cheetah.mjs", | ||
"test/unit/esm-querystring-mjs/input.js", | ||
"test/unit/esm-querystring-mjs/package.json" | ||
] |
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,4 @@ | ||
{ | ||
"private": true, | ||
"type": "module" | ||
} |
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,4 @@ | ||
import { numSpecies } from './bear?beaver?bison'; | ||
console.log(`There are ${numSpecies} species of bears.`); | ||
|
||
export const food = 'termites'; |
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,4 @@ | ||
import * as cheetah from './cheetah?cow=chipmunk'; | ||
console.log(`Cheetahs can run ${cheetah.topSpeed} mph.`); | ||
|
||
export const numSpecies = 8; |
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 @@ | ||
export const topSpeed = 65; |
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,5 @@ | ||
// Test that querystrings of various forms get stripped from esm imports | ||
|
||
import * as aardvark from './animalFacts/aardvark?anteater'; | ||
|
||
console.log(`Aardvarks eat ${aardvark.food}.`); |
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,7 @@ | ||
[ | ||
"test/unit/esm-querystring/animalFacts/aardvark.js", | ||
"test/unit/esm-querystring/animalFacts/bear.js", | ||
"test/unit/esm-querystring/animalFacts/cheetah.js", | ||
"test/unit/esm-querystring/input.js", | ||
"test/unit/esm-querystring/package.json" | ||
] |
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,4 @@ | ||
{ | ||
"private": true, | ||
"type": "module" | ||
} |
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,5 @@ | ||
import * as dep from './dep'; | ||
|
||
export const dogs = ['Charlie', 'Maisey']; | ||
export const cats = ['Piper']; | ||
export const rats = dep.rats; |
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 @@ | ||
export const rats = ['Debra']; |
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,10 @@ | ||
// Test that if a file and the same file with a querystring correspond to different | ||
// modules in memory, one can successfully import the other. The import chain | ||
// goes `input` (this file) -> `base?__withQuery` -> `base` -> `dep`, which means | ||
// that if `dep` shows up in `output`, we know that both `base?__withQuery` and | ||
// `base` have been loaded successfully. | ||
|
||
import * as baseWithQuery from './base?__withQuery'; | ||
console.log('Dogs:', baseWithQuery.dogs); | ||
console.log('Cats:', baseWithQuery.cats); | ||
console.log('Rats:', baseWithQuery.rats); |
Oops, something went wrong.