tests: added environment test (#3983)

This commit is contained in:
Richard Moore 2023-04-25 20:03:40 +09:00
parent 7e272a314f
commit 6c9b7e2a15
5 changed files with 56 additions and 1 deletions

@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test: [ "ts-import-cjs-node16", "ts-import-esm-node16", "ts-import-cjs", "ts-import-esm" ]
test: [ "ts-import-cjs-node16", "ts-import-esm-node16", "ts-import-cjs", "ts-import-esm", "test-3983" ]
steps:
- name: Use Node.js

@ -0,0 +1,2 @@
index.d.ts
index.js

@ -0,0 +1,5 @@
import { ethers } from "ethers";
console.log("Version:", ethers.version);
console.log(ethers.getAddress("0x0123456789abcdef0123456789abcdef01234567"));

@ -0,0 +1,29 @@
{
"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",
"clean": "rm -rf node_modules package-lock.json *.js *.d.ts",
"postinstall": "find node_modules | grep package.json",
"test": "npm run build && node index.js"
},
"keywords": [
"ethers",
"tests",
"typescipt"
],
"author": "Richard Moore <me@ricmoo.com>",
"license": "MIT"
}

@ -0,0 +1,19 @@
{
"compilerOptions": {
"declaration": true,
"importHelpers": false,
"lib": [
"dom",
"es2020",
"es5"
],
"module": "commonjs",
"moduleResolution": "nodenext",
"strict": true,
"target": "es2022"
},
"exclude": [ ],
"include": [
"./index.ts"
],
}