From e2c4fe17d86f9e578d93e5a06c2a7efc2ef84298 Mon Sep 17 00:00:00 2001 From: Sebastien Guillemot Date: Sat, 30 Sep 2023 23:06:34 +0900 Subject: [PATCH] Fix test setup --- .github/workflows/nodejs.yml | 4 ++-- nx.json | 3 +++ package.json | 1 + packages/contracts/nft/foundry.toml | 8 ++++---- .../contracts/paima-l2-contract/foundry.toml | 17 ++++++++--------- .../paima-sdk/paima-utils-backend/package.json | 3 +-- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index e17baa914..c950397c1 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -46,9 +46,9 @@ jobs: main-branch-name: 'master' - name: Install deps run: npm ci --prefer-offline --no-audit - - name: Test affected - run: npx nx affected -t test - name: Build affected run: npm run build + - name: Test affected + run: npm run test - name: Lint affected run: npm run lint diff --git a/nx.json b/nx.json index 023a6d53c..094fa66d9 100644 --- a/nx.json +++ b/nx.json @@ -12,6 +12,9 @@ "lint:eslint": { "dependsOn": ["build", "^build"] }, + "test": { + "dependsOn": ["^build"] + }, "build": { "dependsOn": ["^build"] }, diff --git a/package.json b/package.json index eede10887..2fc29ca9a 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "prettier": "prettier --plugin=prettier-plugin-solidity --ignore-path ./.prettierignore --write '**/*.{sol,ts,tsx}'", "prebuild": "npx nx run-many --parallel=${PARALLEL:-3} -t prebuild", "build": "npm run lint:configs && npx nx run-many --parallel=${PARALLEL:-3} -t build", + "test": "npm run lint:configs && npx nx run-many --parallel=${PARALLEL:-3} -t test", "release:lib": "npm run lint:configs && sh ./tools/scripts/bump-version.sh && npx nx release publish -g paima-sdk -d", "release:bin": "npm run lint:configs && npx nx run-many --parallel=${PARALLEL:-3} -t release && cp -r ./packages/engine/paima-standalone/packaged/@standalone/* ./bin" }, diff --git a/packages/contracts/nft/foundry.toml b/packages/contracts/nft/foundry.toml index 39ed7a9b6..03d5c1717 100644 --- a/packages/contracts/nft/foundry.toml +++ b/packages/contracts/nft/foundry.toml @@ -2,7 +2,7 @@ src = 'src' out = 'out' libs = ['lib'] -remappings = [ # a list of remappings - '@openzeppelin/=node_modules/@openzeppelin/' -] -# See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file +remappings = [ # a list of remappings + '@openzeppelin/=../../../node_modules/@openzeppelin/', +] +# See more config options https://github.com/foundry-rs/foundry/tree/master/config diff --git a/packages/contracts/paima-l2-contract/foundry.toml b/packages/contracts/paima-l2-contract/foundry.toml index e11b54efc..db8f4ff8b 100644 --- a/packages/contracts/paima-l2-contract/foundry.toml +++ b/packages/contracts/paima-l2-contract/foundry.toml @@ -1,15 +1,15 @@ [default] -src = 'src' # the source directory -test = 'test' # the test directory -out = 'build/artifacts' # the output directory (for artifacts) -libs = ['test-lib'] # a list of library directories -remappings = [ # a list of remappings - '@openzeppelin/=node_modules/@openzeppelin/' -] +src = 'src' # the source directory +test = 'test' # the test directory +out = 'build/artifacts' # the output directory (for artifacts) +libs = ['test-lib'] # a list of library directories +remappings = [ # a list of remappings + '@openzeppelin/=../../../node_modules/@openzeppelin/', +] #libraries = [] # a list of deployed libraries to link against #cache = true # whether to cache builds or not #force = false # whether to ignore the cache (clean build) -evm_version = 'berlin' # the evm version (by hardfork name) +evm_version = 'berlin' # the evm version (by hardfork name) #solc_version = '0.8.7' # override for the solc version (setting this ignores `auto_detect_solc`) #auto_detect_solc = true # enable auto-detection of the appropriate solc version to use #optimizer = true # enable or disable the solc optimizer @@ -29,4 +29,3 @@ evm_version = 'berlin' # the evm version #block_coinbase = '0x0000000000000000000000000000000000000000' # the address of `block.coinbase` in tests #block_timestamp = 0 # the value of `block.timestamp` in tests #block_difficulty = 0 # the value of `block.difficulty` in tests - diff --git a/packages/paima-sdk/paima-utils-backend/package.json b/packages/paima-sdk/paima-utils-backend/package.json index 61bdec378..1f5abedc9 100644 --- a/packages/paima-sdk/paima-utils-backend/package.json +++ b/packages/paima-sdk/paima-utils-backend/package.json @@ -22,8 +22,7 @@ "homepage": "https://docs.paimastudios.com", "scripts": { "lint:eslint": "eslint .", - "build": "tsc", - "test": "jest" + "build": "tsc" }, "devDependencies": { "@types/node": "^18.17.1",