forked from parcel-bundler/parcel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(core): add draft version of tests
- Loading branch information
1 parent
51b470e
commit 42cd041
Showing
9 changed files
with
290 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/core/integration-tests/test/integration/formats/amd/cjs-require.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,5 @@ | ||
const rd = require('react-dom') | ||
const {upperCase} = require('lodash') | ||
|
||
console.log(rd) | ||
console.log(upperCase('foo')) |
6 changes: 6 additions & 0 deletions
6
packages/core/integration-tests/test/integration/formats/amd/conflicting-names.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,6 @@ | ||
const {upperCase} = require('lodash') | ||
|
||
function lodash(s) { | ||
console.log(s) | ||
} | ||
lodash(upperCase('foo')) |
3 changes: 3 additions & 0 deletions
3
packages/core/integration-tests/test/integration/formats/amd/default-export.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,3 @@ | ||
import _ from 'lodash'; | ||
|
||
console.log(_.upperCase('hello world ')) |
1 change: 1 addition & 0 deletions
1
packages/core/integration-tests/test/integration/formats/amd/exports.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 @@ | ||
export const LuckySeven = 777 |
3 changes: 3 additions & 0 deletions
3
packages/core/integration-tests/test/integration/formats/amd/import-star.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,3 @@ | ||
import * as lodashAll from 'lodash'; | ||
|
||
console.log(lodashAll.upperCase('hello world ')) |
10 changes: 10 additions & 0 deletions
10
packages/core/integration-tests/test/integration/formats/amd/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,10 @@ | ||
{ | ||
"name": "amd", | ||
"private": true, | ||
"main": "dist/index.js", | ||
"dependencies": { | ||
"lodash": "^4.17.11", | ||
"react": "^16.11.0", | ||
"react-dom": "^16.11.0" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/core/integration-tests/test/integration/formats/amd/with-dynamic-import.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,5 @@ | ||
document.querySelector('button').addEventListener('click', () => { | ||
import('./exports.js').then(module => { | ||
console.log(module) | ||
}) | ||
}) |
7 changes: 7 additions & 0 deletions
7
packages/core/integration-tests/test/integration/formats/amd/with-external-deps.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,7 @@ | ||
import { upperCase, kebabCase } from 'lodash'; | ||
import { render } from 'react-dom'; | ||
import 'react'; | ||
|
||
render(document.getElementById('app'), function App() { | ||
return upperCase('hello world ') + kebabCase('from Kevin and Stuart and Bob') | ||
}) |
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