admin: adding initial environment tests
This commit is contained in:
parent
10e03e095b
commit
db550971c0
44
.github/workflows/test-env.yml
vendored
Normal file
44
.github/workflows/test-env.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
name: Environment Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
|
||||
test-env:
|
||||
name: Test Environments
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
npm_config_registry: http://localhost:8043
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [ "ts-import-cjs-node16", "ts-import-esm-node16", "ts-import-cjs", "ts-import-esm" ]
|
||||
|
||||
steps:
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 18.x
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: "faux_modules/ethers"
|
||||
|
||||
- name: Install and run Faux Registry
|
||||
uses: ethers-io/hijack-npm-action
|
||||
|
||||
- name: Copy tests to working directory
|
||||
run: cp faux-npm/ethers/testcases/test-env/${{ matrix.test }}/* .
|
||||
|
||||
- name: Install packages
|
||||
run: npm install
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
2
testcases/test-env/.gitignore
vendored
Normal file
2
testcases/test-env/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*/node_modules/**
|
||||
*/pacakge-lock.json
|
2
testcases/test-env/ts-import-cjs-node16/.gitignore
vendored
Normal file
2
testcases/test-env/ts-import-cjs-node16/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
index.d.ts
|
||||
index.js
|
5
testcases/test-env/ts-import-cjs-node16/index.ts
Normal file
5
testcases/test-env/ts-import-cjs-node16/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { ethers } from "ethers";
|
||||
|
||||
console.log("Version:", ethers.version);
|
||||
|
||||
console.log(ethers.getAddress("0x0123456789abcdef0123456789abcdef01234567"));
|
19
testcases/test-env/ts-import-cjs-node16/package.json
Normal file
19
testcases/test-env/ts-import-cjs-node16/package.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "test",
|
||||
"dependencies": {
|
||||
"ethers": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"version": "0.0.1",
|
||||
"description": "Test case for simple import for ethers.",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
"publishConfig": { "access": "private" },
|
||||
"scripts": {
|
||||
"build": "tsc --project tsconfig.json",
|
||||
"test": "npm run build && node index.js"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
19
testcases/test-env/ts-import-cjs-node16/tsconfig.json
Normal file
19
testcases/test-env/ts-import-cjs-node16/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"importHelpers": false,
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2020",
|
||||
"es5"
|
||||
],
|
||||
"module": "es2020",
|
||||
"moduleResolution": "node16",
|
||||
"strict": true,
|
||||
"target": "es2022"
|
||||
},
|
||||
"exclude": [ ],
|
||||
"include": [
|
||||
"./index.ts"
|
||||
],
|
||||
}
|
2
testcases/test-env/ts-import-cjs/.gitignore
vendored
Normal file
2
testcases/test-env/ts-import-cjs/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
index.d.ts
|
||||
index.js
|
5
testcases/test-env/ts-import-cjs/index.ts
Normal file
5
testcases/test-env/ts-import-cjs/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { ethers } from "ethers";
|
||||
|
||||
console.log("Version:", ethers.version);
|
||||
|
||||
console.log(ethers.getAddress("0x0123456789abcdef0123456789abcdef01234567"));
|
19
testcases/test-env/ts-import-cjs/package.json
Normal file
19
testcases/test-env/ts-import-cjs/package.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "test",
|
||||
"dependencies": {
|
||||
"ethers": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"version": "0.0.1",
|
||||
"description": "Test case for simple import for ethers.",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
"publishConfig": { "access": "private" },
|
||||
"scripts": {
|
||||
"build": "tsc --project tsconfig.json",
|
||||
"test": "npm run build && node index.js"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
19
testcases/test-env/ts-import-cjs/tsconfig.json
Normal file
19
testcases/test-env/ts-import-cjs/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"importHelpers": false,
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2020",
|
||||
"es5"
|
||||
],
|
||||
"module": "es2020",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"target": "es2022"
|
||||
},
|
||||
"exclude": [ ],
|
||||
"include": [
|
||||
"./index.ts"
|
||||
],
|
||||
}
|
2
testcases/test-env/ts-import-esm-node16/.gitignore
vendored
Normal file
2
testcases/test-env/ts-import-esm-node16/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
index.d.ts
|
||||
index.js
|
5
testcases/test-env/ts-import-esm-node16/index.ts
Normal file
5
testcases/test-env/ts-import-esm-node16/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { ethers } from "ethers";
|
||||
|
||||
console.log("Version:", ethers.version);
|
||||
|
||||
console.log(ethers.getAddress("0x0123456789abcdef0123456789abcdef01234567"));
|
28
testcases/test-env/ts-import-esm-node16/package.json
Normal file
28
testcases/test-env/ts-import-esm-node16/package.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "test",
|
||||
"dependencies": {
|
||||
"ethers": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"version": "0.0.1",
|
||||
"description": "Test case for simple import for ethers.",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
"publishConfig": {
|
||||
"access": "private"
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --project tsconfig.json",
|
||||
"test": "npm run build && node index.js"
|
||||
},
|
||||
"keywords": [
|
||||
"ethers",
|
||||
"tests",
|
||||
"typescipt"
|
||||
],
|
||||
"author": "Richard Moore <me@ricmoo.com>",
|
||||
"license": "MIT"
|
||||
}
|
19
testcases/test-env/ts-import-esm-node16/tsconfig.json
Normal file
19
testcases/test-env/ts-import-esm-node16/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"importHelpers": false,
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2020",
|
||||
"es5"
|
||||
],
|
||||
"module": "es2020",
|
||||
"moduleResolution": "node16",
|
||||
"strict": true,
|
||||
"target": "es2022"
|
||||
},
|
||||
"exclude": [ ],
|
||||
"include": [
|
||||
"./index.ts"
|
||||
],
|
||||
}
|
2
testcases/test-env/ts-import-esm/.gitignore
vendored
Normal file
2
testcases/test-env/ts-import-esm/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
index.d.ts
|
||||
index.js
|
5
testcases/test-env/ts-import-esm/index.ts
Normal file
5
testcases/test-env/ts-import-esm/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { ethers } from "ethers";
|
||||
|
||||
console.log("Version:", ethers.version);
|
||||
|
||||
console.log(ethers.getAddress("0x0123456789abcdef0123456789abcdef01234567"));
|
28
testcases/test-env/ts-import-esm/package.json
Normal file
28
testcases/test-env/ts-import-esm/package.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "test",
|
||||
"dependencies": {
|
||||
"ethers": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"version": "0.0.1",
|
||||
"description": "Test case for simple import for ethers.",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
"publishConfig": {
|
||||
"access": "private"
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc --project tsconfig.json",
|
||||
"test": "npm run build && node index.js"
|
||||
},
|
||||
"keywords": [
|
||||
"ethers",
|
||||
"tests",
|
||||
"typescipt"
|
||||
],
|
||||
"author": "Richard Moore <me@ricmoo.com>",
|
||||
"license": "MIT"
|
||||
}
|
19
testcases/test-env/ts-import-esm/tsconfig.json
Normal file
19
testcases/test-env/ts-import-esm/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"importHelpers": false,
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2020",
|
||||
"es5"
|
||||
],
|
||||
"module": "es2020",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"target": "es2022"
|
||||
},
|
||||
"exclude": [ ],
|
||||
"include": [
|
||||
"./index.ts"
|
||||
],
|
||||
}
|
Loading…
Reference in New Issue
Block a user