-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Setup test apps for upcoming snapshot tests (#17)
Create some initial test apps for the upcoming snapshot tests.
- Loading branch information
1 parent
0ba0d59
commit e224faf
Showing
28 changed files
with
774 additions
and
375 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
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
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,27 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const packageJson = require("./package.json") as { version: string }; | ||
|
||
const config = { | ||
testEnvironment: "node", | ||
collectCoverageFrom: ["!**/node_modules/**"], | ||
transform: { | ||
"^.+\\.(t|j)sx?$": [ | ||
"@swc/jest", | ||
{ | ||
jsc: { | ||
transform: { | ||
optimizer: { | ||
globals: { | ||
vars: { | ||
__PACKAGE_VERSION__: packageJson.version, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default config; |
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,24 @@ | ||
{ | ||
"name": "integration-tests", | ||
"version": "1.0.0", | ||
"description": "", | ||
"private": true, | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"dependencies": { | ||
"@swc/core": "^1.3.99", | ||
"@swc/jest": "^0.2.29", | ||
"@types/jest": "^29.5.10", | ||
"@types/node": "^20.10.3", | ||
"jest": "^29.7.0", | ||
"rollup": "4.6.0", | ||
"ts-node": "^10.9.1", | ||
"vite": "5.0.3", | ||
"webpack": "5.89.0" | ||
}, | ||
"volta": { | ||
"extends": "../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,23 @@ | ||
{ | ||
"name": "rollup", | ||
"version": "1.0.0", | ||
"private": true, | ||
"license": "MIT", | ||
"type": "module", | ||
"scripts": { | ||
"build": "rollup -c" | ||
}, | ||
"dependencies": { | ||
"@codecov/rollup-plugin": "workspace:^", | ||
"@rollup/plugin-commonjs": "^17.0.0", | ||
"@rollup/plugin-node-resolve": "^11.1.0", | ||
"lodash": "^4.17.21", | ||
"rollup": "^4.6.1" | ||
}, | ||
"volta": { | ||
"extends": "../../../package.json" | ||
}, | ||
"engines": { | ||
"node": ">=18.0.0" | ||
} | ||
} |
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,20 @@ | ||
import resolve from "@rollup/plugin-node-resolve"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import { codecovRollupPlugin } from "@codecov/rollup-plugin"; | ||
import { defineConfig } from "rollup"; | ||
|
||
export default defineConfig({ | ||
input: "src/main.js", | ||
output: { | ||
dir: "dist", | ||
entryFileNames: "[name]-[hash].js", | ||
}, | ||
plugins: [ | ||
resolve(), | ||
commonjs(), | ||
codecovRollupPlugin({ | ||
enableBundleAnalysis: true, | ||
dryRun: true, | ||
}), | ||
], | ||
}); |
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 @@ | ||
export function getRandomNumber(min, max) { | ||
return Math.floor(Math.random() * (max - min + 1)) + min; | ||
} |
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 @@ | ||
import _ from "lodash"; | ||
import { getRandomNumber } from "./getRandomNumber.js"; | ||
|
||
const randomNumber = getRandomNumber(1, 10); | ||
|
||
const output = `Is ${randomNumber} between 0 and 5: ${_.inRange( | ||
randomNumber, | ||
0, | ||
5, | ||
)}`; | ||
|
||
console.log(randomNumber); // Outputs a random number between 1 and 10 |
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,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
</html> |
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,21 @@ | ||
{ | ||
"name": "vite", | ||
"version": "1.0.0", | ||
"private": true, | ||
"license": "MIT", | ||
"type": "module", | ||
"scripts": { | ||
"build": "vite build" | ||
}, | ||
"dependencies": { | ||
"@codecov/vite-plugin": "workspace:^", | ||
"lodash": "^4.17.21", | ||
"vite": "5.0.3" | ||
}, | ||
"volta": { | ||
"extends": "../../../package.json" | ||
}, | ||
"engines": { | ||
"node": ">=18.0.0" | ||
} | ||
} |
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 @@ | ||
export function getRandomNumber(min, max) { | ||
return Math.floor(Math.random() * (max - min + 1)) + min; | ||
} |
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 @@ | ||
import _ from "lodash"; | ||
import { getRandomNumber } from "./getRandomNumber.js"; | ||
|
||
const randomNumber = getRandomNumber(1, 10); | ||
|
||
const output = `Is ${randomNumber} between 0 and 5: ${_.inRange( | ||
randomNumber, | ||
0, | ||
5, | ||
)}`; | ||
|
||
console.log(randomNumber); // Outputs a random number between 1 and 10 |
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,11 @@ | ||
import { defineConfig } from "vite"; | ||
import { codecovVitePlugin } from "@codecov/vite-plugin"; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
codecovVitePlugin({ | ||
enableBundleAnalysis: true, | ||
dryRun: true, | ||
}), | ||
], | ||
}); |
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,20 @@ | ||
{ | ||
"name": "webpack", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"type": "module", | ||
"scripts": { | ||
"build": "webpack --config webpack.config.cjs" | ||
}, | ||
"dependencies": { | ||
"@codecov/webpack-plugin": "workspace:^", | ||
"lodash": "^4.17.21", | ||
"webpack": "5.89.0" | ||
}, | ||
"volta": { | ||
"extends": "../../../package.json" | ||
}, | ||
"engines": { | ||
"node": ">=18.0.0" | ||
} | ||
} |
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 @@ | ||
export function getRandomNumber(min, max) { | ||
return Math.floor(Math.random() * (max - min + 1)) + min; | ||
} |
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 @@ | ||
import _ from "lodash"; | ||
import { getRandomNumber } from "./getRandomNumber.js"; | ||
|
||
const randomNumber = getRandomNumber(1, 10); | ||
|
||
const output = `Is ${randomNumber} between 0 and 5: ${_.inRange( | ||
randomNumber, | ||
0, | ||
5, | ||
)}`; | ||
|
||
console.log(randomNumber); // Outputs a random number between 1 and 10 |
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,17 @@ | ||
const path = require("path"); | ||
const { codecovWebpackPlugin } = require("@codecov/webpack-plugin"); | ||
|
||
module.exports = { | ||
entry: "./src/main.js", | ||
mode: "production", | ||
output: { | ||
path: path.resolve(__dirname, "dist"), | ||
filename: "[name].[contenthash].chunk.js", | ||
}, | ||
plugins: [ | ||
codecovWebpackPlugin({ | ||
enableBundleAnalysis: true, | ||
dryRun: true, | ||
}), | ||
], | ||
}; |
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 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"include": ["jest.config.ts"], | ||
"exclude": ["coverage/**/*", "node_modules/**/*", "./test-apps/**/*"] | ||
} |
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
Oops, something went wrong.