Repository: solana-labs/solana-program-library
Pull request #6035 (2023-12-29 11:06:08)

build(deps-dev): bump chai from 4.3.10 to 5.0.0
Bumps [chai](https://github.com/chaijs/chai) from 4.3.10 to 5.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/chaijs/chai/releases">chai's releases</a>.</em></p>
<blockquote>
<h2>v5.0.0</h2>
<h2>BREAKING CHANGES</h2>
<ul>
<li>Chai now only supports EcmaScript Modules (ESM). This means your tests will need to either have <code>import {...} from 'chai'</code> or <code>import('chai')</code>. <code>require('chai')</code> will cause failures in nodejs. If you're using ESM and seeing failures, it may be due to a bundler or transpiler which is incorrectly converting import statements into require calls.</li>
<li>Dropped support for Internet Explorer.</li>
<li>Dropped support for NodeJS &lt; 18.</li>
<li>Minimum supported browsers are now Firefox 100, Safari 14.1, Chrome 100, Edge 100. Support for browsers prior to these versions is &quot;best effort&quot; (bug reports on older browsers will be assessed individually and may be marked as wontfix).</li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>feat: use chaijs/loupe for inspection by <a href="https://github.com/pcorpet"><code>@​pcorpet</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1401">chaijs/chai#1401</a></li>
<li>docs: fix URL in README by <a href="https://github.com/Izzur"><code>@​Izzur</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1413">chaijs/chai#1413</a></li>
<li>Remove <code>get-func-name</code> dependency by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1416">chaijs/chai#1416</a></li>
<li>Convert Makefile script to npm scripts by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1424">chaijs/chai#1424</a></li>
<li>Clean up README badges by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1422">chaijs/chai#1422</a></li>
<li>fix: package.json - deprecation warning on exports field by <a href="https://github.com/stevenjoezhang"><code>@​stevenjoezhang</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1400">chaijs/chai#1400</a></li>
<li>fix: deep-eql bump package to support symbols by <a href="https://github.com/snewcomer"><code>@​snewcomer</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1458">chaijs/chai#1458</a></li>
<li>ES module conversion PoC by <a href="https://github.com/43081j"><code>@​43081j</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1498">chaijs/chai#1498</a></li>
<li>chore: drop commonjs support by <a href="https://github.com/43081j"><code>@​43081j</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1503">chaijs/chai#1503</a></li>
<li>Update pathval by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1527">chaijs/chai#1527</a></li>
<li>Update check-error by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1528">chaijs/chai#1528</a></li>
<li>update <code>deep-eql</code> to latest version by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1542">chaijs/chai#1542</a></li>
<li>Inline <code>type-detect</code> as a simple function by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1544">chaijs/chai#1544</a></li>
<li>Update loupe by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1545">chaijs/chai#1545</a></li>
<li>Typo 'Test an object' not 'Test and object' by <a href="https://github.com/mavaddat"><code>@​mavaddat</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1460">chaijs/chai#1460</a></li>
<li>Update <code>assertion-error</code> to it's latest major version! by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1543">chaijs/chai#1543</a></li>
<li>Replacing Karma with Web Test Runner by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1546">chaijs/chai#1546</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/Izzur"><code>@​Izzur</code></a> made their first contribution in <a href="https://redirect.github.com/chaijs/chai/pull/1413">chaijs/chai#1413</a></li>
<li><a href="https://github.com/stevenjoezhang"><code>@​stevenjoezhang</code></a> made their first contribution in <a href="https://redirect.github.com/chaijs/chai/pull/1400">chaijs/chai#1400</a></li>
<li><a href="https://github.com/43081j"><code>@​43081j</code></a> made their first contribution in <a href="https://redirect.github.com/chaijs/chai/pull/1498">chaijs/chai#1498</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/chaijs/chai/compare/4.3.1...v5.0.0">https://github.com/chaijs/chai/compare/4.3.1...v5.0.0</a></p>
<h2>v5.0.0-rc.0</h2>
<p>The first Release Candidate of chai@v5 is here!</p>
<p>We've put out a few alpha versions and tested them out in various projects with good success. This RC includes all those changes plus any fixes that we've discovered since then.</p>
<p>Please try it out in your projects and let us know if you run into any issues so we can make fixes before version 5!</p>
<p>Thanks for using Chai 🙏🏻</p>
<h2>What's Changed</h2>
<ul>
<li>feat: use chaijs/loupe for inspection by <a href="https://github.com/pcorpet"><code>@​pcorpet</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1401">chaijs/chai#1401</a></li>
<li>docs: fix URL in README by <a href="https://github.com/Izzur"><code>@​Izzur</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1413">chaijs/chai#1413</a></li>
<li>Remove <code>get-func-name</code> dependency by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1416">chaijs/chai#1416</a></li>
<li>Convert Makefile script to npm scripts by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1424">chaijs/chai#1424</a></li>
<li>Clean up README badges by <a href="https://github.com/koddsson"><code>@​koddsson</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1422">chaijs/chai#1422</a></li>
<li>fix: package.json - deprecation warning on exports field by <a href="https://github.com/stevenjoezhang"><code>@​stevenjoezhang</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1400">chaijs/chai#1400</a></li>
<li>fix: deep-eql bump package to support symbols by <a href="https://github.com/snewcomer"><code>@​snewcomer</code></a> in <a href="https://redirect.github.com/chaijs/chai/pull/1458">chaijs/chai#1458</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/chaijs/chai/commit/723759c18c29a302e4fef607ce22ffc223767c9e"><code>723759c</code></a> 5.0.0</li>
<li><a href="https://github.com/chaijs/chai/commit/947ff86fad51d6a34ad794655cab577a9b7acf3e"><code>947ff86</code></a> update deep-eql to latest version</li>
<li><a href="https://github.com/chaijs/chai/commit/0fc290b5ea9888c29d146754fd52146e0f04381d"><code>0fc290b</code></a> Replacing Karma with Web Test Runner (<a href="https://redirect.github.com/chaijs/chai/issues/1546">#1546</a>)</li>
<li><a href="https://github.com/chaijs/chai/commit/54d3e6b0f7c1b9e3b46c8e53e2e3513431b87926"><code>54d3e6b</code></a> Update <code>assertion-error</code> to it's latest major version! (<a href="https://redirect.github.com/chaijs/chai/issues/1543">#1543</a>)</li>
<li><a href="https://github.com/chaijs/chai/commit/528f4daaa74c337eb1438684222ff6500f212424"><code>528f4da</code></a> Typo 'Test an object' not 'Test and object' (<a href="https://redirect.github.com/chaijs/chai/issues/1460">#1460</a>)</li>
<li><a href="https://github.com/chaijs/chai/commit/901129885dd57516da0b907ced1ac83b7e572ec0"><code>9011298</code></a> update loupe (<a href="https://redirect.github.com/chaijs/chai/issues/1545">#1545</a>)</li>
<li><a href="https://github.com/chaijs/chai/commit/9e276dcfaf749c50ddb1f8e315b79f50ad1b38fd"><code>9e276dc</code></a> Inline <code>type-detect</code> as a simple function (<a href="https://redirect.github.com/chaijs/chai/issues/1544">#1544</a>)</li>
<li><a href="https://github.com/chaijs/chai/commit/de9fa39469e87e3670daccbf0878f5a7a5c0fed2"><code>de9fa39</code></a> update <code>deep-eql</code> to latest version (<a href="https://redirect.github.com/chaijs/chai/issues/1542">#1542</a>)</li>
<li><a href="https://github.com/chaijs/chai/commit/f32439f9e4b3fdffa745786e1e61c17d56baf11e"><code>f32439f</code></a> 5.0.0-alpha.1</li>
<li><a href="https://github.com/chaijs/chai/commit/c6481e07baa10d6535afe9bc5235dcf8ae1415e6"><code>c6481e0</code></a> update check-error (<a href="https://redirect.github.com/chaijs/chai/issues/1528">#1528</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/chaijs/chai/compare/v4.3.10...v5.0.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=chai&package-manager=npm_and_yarn&previous-version=4.3.10&new-version=5.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

mergify[bot]: automerge label removed due to a CI failure

Patch:
diff --git a/account-compression/sdk/package.json b/account-compression/sdk/package.json
index 461f4f68d..aba0c5097 100644
--- a/account-compression/sdk/package.json
+++ b/account-compression/sdk/package.json
@@ -70,12 +70,10 @@
     "@solana/eslint-config-solana": "^1.0.2",
     "@solana/prettier-config-solana": "^0.0.4",
     "@types/bn.js": "^5.1.0",
-    "@types/chai": "^4.3.0",
     "@types/jest": "^29.5.11",
     "@types/node-fetch": "^2.6.11",
     "@typescript-eslint/eslint-plugin": "^6.19.1",
     "@typescript-eslint/parser": "^6.19.1",
-    "chai": "^4.3.4",
     "eslint": "^8.56.0",
     "eslint-config-prettier": "^9.1.0",
     "eslint-config-turbo": "^1.11.3",
diff --git a/libraries/type-length-value/js/package.json b/libraries/type-length-value/js/package.json
index 008c9a3ad..062f40211 100644
--- a/libraries/type-length-value/js/package.json
+++ b/libraries/type-length-value/js/package.json
@@ -49,8 +49,7 @@
         "@types/node": "^20.11.6",
         "@typescript-eslint/eslint-plugin": "^6.19.1",
         "@typescript-eslint/parser": "^6.19.1",
-        "chai": "^4.3.10",
-        "chai-as-promised": "^7.1.1",
+        "chai": "^5.0.0",
         "eslint": "^8.56.0",
         "eslint-config-prettier": "^9.1.0",
         "eslint-plugin-prettier": "^5.1.3",
diff --git a/memo/js/jest.config.cjs b/memo/js/jest.config.cjs
deleted file mode 100644
index 575330196..000000000
--- a/memo/js/jest.config.cjs
+++ /dev/null
@@ -1,6 +0,0 @@
-/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
-module.exports = {
-    transform: {
-      '^.+\\.ts?$': 'ts-jest',
-    },
-};
diff --git a/memo/js/jest.config.ts b/memo/js/jest.config.ts
new file mode 100644
index 000000000..586fb9fe3
--- /dev/null
+++ b/memo/js/jest.config.ts
@@ -0,0 +1,7 @@
+import type { JestConfigWithTsJest } from 'ts-jest';
+
+const jestConfig: JestConfigWithTsJest = {
+    preset: 'ts-jest/presets/default-esm',
+};
+
+export default jestConfig;
diff --git a/memo/js/package.json b/memo/js/package.json
index cbc7480df..e74f5b53e 100644
--- a/memo/js/package.json
+++ b/memo/js/package.json
@@ -39,8 +39,8 @@
         "lint": "prettier --check '{*,**/*}.{ts,tsx,js,jsx,json}' && eslint --max-warnings 0 .",
         "lint:fix": "npm run fmt && eslint --fix .",
         "test": "npm run test:unit && npm run test:e2e",
-        "test:unit": "jest test/unit",
-        "test:e2e": "start-server-and-test 'solana-test-validator -r -q' http://127.0.0.1:8899/health 'jest test/e2e'",
+        "test:unit": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest test/unit",
+        "test:e2e": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" start-server-and-test 'solana-test-validator -r -q' http://127.0.0.1:8899/health 'jest test/e2e'",
         "deploy": "npm run deploy:docs",
         "docs": "shx rm -rf docs && typedoc && shx cp .nojekyll docs/",
         "deploy:docs": "npm run docs && gh-pages --dest memo/js --dist docs --dotfiles"
@@ -59,7 +59,7 @@
         "@types/node-fetch": "^2.6.11",
         "@typescript-eslint/eslint-plugin": "^6.19.1",
         "@typescript-eslint/parser": "^6.19.1",
-        "chai": "^4.3.6",
+        "chai": "^5.0.0",
         "eslint": "^8.56.0",
         "eslint-config-prettier": "^9.1.0",
         "eslint-plugin-prettier": "^5.1.3",
diff --git a/name-service/js/jest.config.ts b/name-service/js/jest.config.ts
new file mode 100644
index 000000000..586fb9fe3
--- /dev/null
+++ b/name-service/js/jest.config.ts
@@ -0,0 +1,7 @@
+import type { JestConfigWithTsJest } from 'ts-jest';
+
+const jestConfig: JestConfigWithTsJest = {
+    preset: 'ts-jest/presets/default-esm',
+};
+
+export default jestConfig;
diff --git a/name-service/js/package.json b/name-service/js/package.json
index cb12fca4a..0a5065d39 100644
--- a/name-service/js/package.json
+++ b/name-service/js/package.json
@@ -5,6 +5,8 @@
   "license": "MIT",
   "author": "Solana Labs Maintainers <maintainers@solanalabs.com>",
   "homepage": "https://solana.com/",
+  "type": "module",
+  "sideEffects": false,
   "repository": {
     "type": "git",
     "url": "https://github.com/solana-labs/solana-program-library"
@@ -15,11 +17,21 @@
   "publishConfig": {
     "access": "public"
   },
-  "main": "dist/index.js",
-  "types": "dist/index.d.ts",
+  "files": [
+    "lib",
+    "src",
+    "LICENSE"
+  ],
+  "main": "lib/cjs/index.js",
+  "module": "lib/esm/index.js",
+  "types": "lib/types/index.d.ts",
+  "exports": {
+    "types": "lib/types/index.d.ts",
+    "require": "lib/cjs/index.js",
+    "import": "lib/esm/index.js"
+  },
   "scripts": {
-    "dev": "tsc && node --trace-warnings dist/transfer.js",
-    "build": "tsc",
+    "build": "tsc --build --verbose tsconfig.all.json",
     "build:program": "cargo build-sbf --manifest-path=../program/Cargo.toml",
     "prepublish": "tsc",
     "lint": "npm run pretty && eslint --max-warnings 0 'src/*.ts'",
@@ -28,30 +40,28 @@
     "pretty:fix": "prettier --write '{src/*.ts,test/*/*.ts}'",
     "doc": "npm run typedoc src/index.ts",
     "test": "npm run test:unit && npm run test:e2e",
-    "test:unit": "mocha test/unit",
-    "test:e2e": "start-server-and-test 'solana-test-validator --bpf-program namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX ../../target/deploy/spl_name_service.so --reset --quiet' http://127.0.0.1:8899/health 'mocha test/e2e'"
+    "test:unit": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest test/unit",
+    "test:e2e": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" start-server-and-test 'solana-test-validator --bpf-program namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX ../../target/deploy/spl_name_service.so --reset --quiet' http://127.0.0.1:8899/health 'jest test/e2e'"
   },
   "prettier": {
     "singleQuote": true
   },
   "devDependencies": {
+    "@jest/globals": "^29.7.0",
     "@types/bn.js": "^5.1.1",
-    "@types/chai": "^4.3.11",
-    "@types/chai-as-promised": "^7.1.5",
-    "@types/mocha": "^10.0.6",
-    "@types/node": "^20.11.6",
+    "@types/jest": "^29.5.11",
+    "@types/node": "^20.11.5",
     "@typescript-eslint/eslint-plugin": "^6.19.1",
     "@typescript-eslint/parser": "^6.19.1",
-    "chai": "^4.3.7",
-    "chai-as-promised": "^7.1.1",
     "eslint": "^8.56.0",
     "eslint-config-prettier": "^9.1.0",
     "eslint-plugin-eslint-comments": "^3.2.0",
     "eslint-plugin-functional": "^6.0.0",
     "eslint-plugin-import": "^2.29.1",
-    "mocha": "^10.2.0",
+    "jest": "^29.7.0",
     "prettier": "^3.2.4",
     "start-server-and-test": "^2.0.3",
+    "ts-jest": "^29.1.2",
     "ts-node": "^10.9.2",
     "typedoc": "^0.25.7",
     "typescript": "^5.3.3"
@@ -60,12 +70,5 @@
     "@solana/web3.js": "^1.89.1",
     "bn.js": "^5.1.3",
     "borsh": "^2.0.0"
-  },
-  "mocha": {
-    "require": [
-      "ts-node/register"
-    ],
-    "recursive": true,
-    "extension": "ts"
   }
 }
diff --git a/name-service/js/src/twitter.ts b/name-service/js/src/twitter.ts
index 5748780de..f0a420dbc 100644
--- a/name-service/js/src/twitter.ts
+++ b/name-service/js/src/twitter.ts
@@ -311,13 +311,13 @@ export async function getTwitterRegistryData(
     {
       memcmp: {
         offset: 0,
-        bytes: TWITTER_ROOT_PARENT_REGISTRY_KEY.toBytes(),
+        bytes: TWITTER_ROOT_PARENT_REGISTRY_KEY.toBase58(),
       },
     },
     {
       memcmp: {
         offset: 32,
-        bytes: verifiedPubkey.toBytes(),
+        bytes: verifiedPubkey.toBase58(),
       },
     },
     {
diff --git a/name-service/js/src/utils.ts b/name-service/js/src/utils.ts
index 2a91fab05..1210512b5 100644
--- a/name-service/js/src/utils.ts
+++ b/name-service/js/src/utils.ts
@@ -4,6 +4,7 @@ import { createHash } from 'crypto';
 import {
   AccountInfo,
   Connection,
+  GetProgramAccountsFilter,
   Keypair,
   PublicKey,
   Transaction,
@@ -34,7 +35,7 @@ export class Numberu32 extends BN {
   /**
    * Construct a Numberu64 from Buffer representation
    */
-  static fromBuffer(buffer): BN {
+  static fromBuffer(buffer: Buffer): BN {
     assert(buffer.length === 4, `Invalid buffer length: ${buffer.length}`);
     return new BN(
       [...buffer]
@@ -66,7 +67,7 @@ export class Numberu64 extends BN {
   /**
    * Construct a Numberu64 from Buffer representation
    */
-  static fromBuffer(buffer): BN {
+  static fromBuffer(buffer: Buffer): BN {
     assert(buffer.length === 8, `Invalid buffer length: ${buffer.length}`);
     return new BN(
       [...buffer]
@@ -135,7 +136,7 @@ export async function getNameOwner(
 export async function getFilteredProgramAccounts(
   connection: Connection,
   programId: PublicKey,
-  filters,
+  filters: GetProgramAccountsFilter[],
 ): Promise<{ publicKey: PublicKey; accountInfo: AccountInfo<Buffer> }[]> {
   const resp = await connection.getProgramAccounts(programId, {
     commitment: connection.commitment,
diff --git a/name-service/js/tsconfig.all.json b/name-service/js/tsconfig.all.json
new file mode 100644
index 000000000..985513259
--- /dev/null
+++ b/name-service/js/tsconfig.all.json
@@ -0,0 +1,11 @@
+{
+    "extends": "./tsconfig.root.json",
+    "references": [
+        {
+            "path": "./tsconfig.cjs.json"
+        },
+        {
+            "path": "./tsconfig.esm.json"
+        }
+    ]
+}
diff --git a/name-service/js/tsconfig.base.json b/name-service/js/tsconfig.base.json
new file mode 100644
index 000000000..90620c4e4
--- /dev/null
+++ b/name-service/js/tsconfig.base.json
@@ -0,0 +1,14 @@
+{
+    "include": [],
+    "compilerOptions": {
+        "target": "ESNext",
+        "module": "ESNext",
+        "moduleResolution": "Node",
+        "esModuleInterop": true,
+        "isolatedModules": true,
+        "noEmitOnError": true,
+        "resolveJsonModule": true,
+        "strict": true,
+        "stripInternal": true
+    }
+}
diff --git a/name-service/js/tsconfig.cjs.json b/name-service/js/tsconfig.cjs.json
new file mode 100644
index 000000000..2db9b7156
--- /dev/null
+++ b/name-service/js/tsconfig.cjs.json
@@ -0,0 +1,10 @@
+{
+    "extends": "./tsconfig.base.json",
+    "include": ["src"],
+    "compilerOptions": {
+        "outDir": "lib/cjs",
+        "target": "ES2016",
+        "module": "CommonJS",
+        "sourceMap": true
+    }
+}
diff --git a/name-service/js/tsconfig.esm.json b/name-service/js/tsconfig.esm.json
new file mode 100644
index 000000000..25e7e25e7
--- /dev/null
+++ b/name-service/js/tsconfig.esm.json
@@ -0,0 +1,13 @@
+{
+    "extends": "./tsconfig.base.json",
+    "include": ["src"],
+    "compilerOptions": {
+        "outDir": "lib/esm",
+        "declarationDir": "lib/types",
+        "target": "ES2020",
+        "module": "ES2020",
+        "sourceMap": true,
+        "declaration": true,
+        "declarationMap": true
+    }
+}
diff --git a/name-service/js/tsconfig.json b/name-service/js/tsconfig.json
index c0f2a16df..2f9b239bf 100644
--- a/name-service/js/tsconfig.json
+++ b/name-service/js/tsconfig.json
@@ -1,34 +1,8 @@
 {
-    "ts-node": {
-      "compilerOptions": {
-        "module": "commonjs",
-        "baseUrl": "./",
-        "paths": {
-            "*" : ["types/*"]
-        }
-      }
-    },
+    "extends": "./tsconfig.all.json",
+    "include": ["src", "test"],
     "compilerOptions": {
-      "strict": true,
-      "module": "commonjs",
-      "skipLibCheck": true,
-      "forceConsistentCasingInFileNames": true,
-      "esModuleInterop": true,
-      "allowSyntheticDefaultImports": true,
-      "target": "es2019",
-      "outDir": "dist",
-      "rootDir": "./src",
-      "declaration": true,
-      "noImplicitAny": false,
-      "moduleResolution": "node",
-      "sourceMap": true,
-      "baseUrl": ".",
-      "paths": {
-        "*": ["node_modules/*", "src/types/*"]
-      },
-      "resolveJsonModule": true
-    },
-    "$schema": "https://json.schemastore.org/tsconfig",
-    "include": ["src/*"],
-    "exclude": ["src/**/*.test.ts", "**/node_modules", "dist"]
+        "noEmit": true,
+        "skipLibCheck": true
+    }
 }
diff --git a/name-service/js/tsconfig.root.json b/name-service/js/tsconfig.root.json
new file mode 100644
index 000000000..fadf294ab
--- /dev/null
+++ b/name-service/js/tsconfig.root.json
@@ -0,0 +1,6 @@
+{
+    "extends": "./tsconfig.base.json",
+    "compilerOptions": {
+        "composite": true
+    }
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3cb1ce503..d94a89611 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -56,9 +56,6 @@ importers:
       '@types/bn.js':
         specifier: ^5.1.0
         version: 5.1.5
-      '@types/chai':
-        specifier: ^4.3.0
-        version: 4.3.11
       '@types/jest':
         specifier: ^29.5.11
         version: 29.5.11
@@ -71,9 +68,6 @@ importers:
       '@typescript-eslint/parser':
         specifier: ^6.19.1
         version: 6.19.1(eslint@8.56.0)(typescript@5.3.3)
-      chai:
-        specifier: ^4.3.4
-        version: 4.3.10
       eslint:
         specifier: ^8.56.0
         version: 8.56.0
@@ -151,11 +145,8 @@ importers:
         specifier: ^6.19.1
         version: 6.19.1(eslint@8.56.0)(typescript@5.3.3)
       chai:
-        specifier: ^4.3.10
-        version: 4.3.10
-      chai-as-promised:
-        specifier: ^7.1.1
-        version: 7.1.1(chai@4.3.10)
+        specifier: ^5.0.0
+        version: 5.0.0
       eslint:
         specifier: ^8.56.0
         version: 8.56.0
@@ -215,8 +206,8 @@ importers:
         specifier: ^6.19.1
         version: 6.19.1(eslint@8.56.0)(typescript@5.3.3)
       chai:
-        specifier: ^4.3.6
-        version: 4.3.10
+        specifier: ^5.0.0
+        version: 5.0.0
       eslint:
         specifier: ^8.56.0
         version: 8.56.0
@@ -272,33 +263,24 @@ importers:
         specifier: ^2.0.0
         version: 2.0.0
     devDependencies:
+      '@jest/globals':
+        specifier: ^29.7.0
+        version: 29.7.0
       '@types/bn.js':
         specifier: ^5.1.1
         version: 5.1.5
-      '@types/chai':
-        specifier: ^4.3.11
-        version: 4.3.11
-      '@types/chai-as-promised':
-        specifier: ^7.1.5
-        version: 7.1.8
-      '@types/mocha':
-        specifier: ^10.0.6
-        version: 10.0.6
+      '@types/jest':
+        specifier: ^29.5.11
+        version: 29.5.11
       '@types/node':
-        specifier: ^20.11.6
-        version: 20.11.6
+        specifier: ^20.11.5
+        version: 20.11.5
       '@typescript-eslint/eslint-plugin':
         specifier: ^6.19.1
         version: 6.19.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0)(typescript@5.3.3)
       '@typescript-eslint/parser':
         specifier: ^6.19.1
         version: 6.19.1(eslint@8.56.0)(typescript@5.3.3)
-      chai:
-        specifier: ^4.3.7
-        version: 4.3.10
-      chai-as-promised:
-        specifier: ^7.1.1
-        version: 7.1.1(chai@4.3.10)
       eslint:
         specifier: ^8.56.0
         version: 8.56.0
@@ -314,18 +296,21 @@ importers:
       eslint-plugin-import:
         specifier: ^2.29.1
         version: 2.29.1(@typescript-eslint/parser@6.19.1)(eslint@8.56.0)
-      mocha:
-        specifier: ^10.2.0
-        version: 10.2.0
+      jest:
+        specifier: ^29.7.0
+        version: 29.7.0(@types/node@20.11.5)(ts-node@10.9.2)
       prettier:
         specifier: ^3.2.4
         version: 3.2.4
       start-server-and-test:
         specifier: ^2.0.3
         version: 2.0.3
+      ts-jest:
+        specifier: ^29.1.2
+        version: 29.1.2(@babel/core@7.23.2)(jest@29.7.0)(typescript@5.3.3)
       ts-node:
         specifier: ^10.9.2
-        version: 10.9.2(@types/node@20.11.6)(typescript@5.3.3)
+        version: 10.9.2(@types/node@20.11.5)(typescript@5.3.3)
       typedoc:
         specifier: ^0.25.7
         version: 0.25.7(typescript@5.3.3)
@@ -475,7 +460,7 @@ importers:
         version: 5.1.3(@types/eslint@8.56.2)(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.2.4)
       jest:
         specifier: ^29.0.0
-        version: 29.7.0(@types/node@20.11.6)(ts-node@10.9.2)
+        version: 29.7.0(@types/node@20.11.5)(ts-node@10.9.2)
       prettier:
         specifier: ^3.2.4
         version: 3.2.4
@@ -532,8 +517,8 @@ importers:
         specifier: ^6.19.1
         version: 6.19.1(eslint@8.56.0)(typescript@5.3.3)
       chai:
-        specifier: ^4.3.6
-        version: 4.3.10
+        specifier: ^5.0.0
+        version: 5.0.0
       eslint:
         specifier: ^8.55.0
         version: 8.56.0
@@ -687,8 +672,8 @@ importers:
         specifier: ^6.19.1
         version: 6.19.1(eslint@8.56.0)(typescript@5.3.3)
       chai:
-        specifier: ^4.3.6
-        version: 4.3.10
+        specifier: ^5.0.0
+        version: 5.0.0
       eslint:
         specifier: ^8.56.0
         version: 8.56.0
@@ -836,11 +821,11 @@ importers:
         specifier: ^6.19.1
         version: 6.19.1(eslint@8.56.0)(typescript@5.3.3)
       chai:
-        specifier: ^4.3.6
-        version: 4.3.10
+        specifier: ^5.0.0
+        version: 5.0.0
       chai-as-promised:
         specifier: ^7.1.1
-        version: 7.1.1(chai@4.3.10)
+        version: 7.1.1(chai@5.0.0)
       eslint:
         specifier: ^8.56.0
         version: 8.56.0
@@ -2634,6 +2619,12 @@ packages:
   /@types/node@12.20.55:
     resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==}
 
+  /@types/node@20.11.5:
+    resolution: {integrity: sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==}
+    dependencies:
+      undici-types: 5.26.5
+    dev: true
+
   /@types/node@20.11.6:
     resolution: {integrity: sha512-+EOokTnksGVgip2PbYbr3xnR7kZigh4LbybAfBAw5BpnQ+FqBYUsvCEjYd70IXKlbohQ64mzEYmMtlWUY8q//Q==}
     dependencies:
@@ -3213,8 +3204,9 @@ packages:
       object.assign: 4.1.4
       util: 0.12.5
 
-  /assertion-error@1.1.0:
-    resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==}
+  /assertion-error@2.0.1:
+    resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
+    engines: {node: '>=12'}
     dev: true
 
   /async-sema@3.1.1:
@@ -3570,26 +3562,24 @@ packages:
       nofilter: 3.1.0
     dev: true
 
-  /chai-as-promised@7.1.1(chai@4.3.10):
+  /chai-as-promised@7.1.1(chai@5.0.0):
     resolution: {integrity: sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==}
     peerDependencies:
       chai: '>= 2.1.2 < 5'
     dependencies:
-      chai: 4.3.10
+      chai: 5.0.0
       check-error: 1.0.3
     dev: true
 
-  /chai@4.3.10:
-    resolution: {integrity: sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==}
-    engines: {node: '>=4'}
+  /chai@5.0.0:
+    resolution: {integrity: sha512-HO5p0oEKd5M6HEcwOkNAThAE3j960vIZvVcc0t2tI06Dd0ATu69cEnMB2wOhC5/ZyQ6m67w3ePjU/HzXsSsdBA==}
+    engines: {node: '>=12'}
     dependencies:
-      assertion-error: 1.1.0
-      check-error: 1.0.3
-      deep-eql: 4.1.3
-      get-func-name: 2.0.2
-      loupe: 2.3.7
-      pathval: 1.1.1
-      type-detect: 4.0.8
+      assertion-error: 2.0.1
+      check-error: 2.0.0
+      deep-eql: 5.0.1
+      loupe: 3.1.0
+      pathval: 2.0.0
     dev: true
 
   /chalk@2.4.2:
@@ -3625,6 +3615,11 @@ packages:
       get-func-name: 2.0.2
     dev: true
 
+  /check-error@2.0.0:
+    resolution: {integrity: sha512-tjLAOBHKVxtPoHe/SA7kNOMvhCRdCJ3vETdeY0RuAc9popf+hyaSV6ZEg9hr4cpWF7jmo/JSWEnLDrnijS9Tog==}
+    engines: {node: '>= 16'}
+    dev: true
+
   /check-more-types@2.24.0:
     resolution: {integrity: sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==}
     engines: {node: '>= 0.8.0'}
@@ -3799,6 +3794,25 @@ packages:
     engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
     dev: true
 
+  /create-jest@29.7.0(@types/node@20.11.5)(ts-node@10.9.2):
+    resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==}
+    engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+    hasBin: true
+    dependencies:
+      '@jest/types': 29.6.3
+      chalk: 4.1.2
+      exit: 0.1.2
+      graceful-fs: 4.2.11
+      jest-config: 29.7.0(@types/node@20.11.5)(ts-node@10.9.2)
+      jest-util: 29.7.0
+      prompts: 2.4.2
+    transitivePeerDependencies:
+      - '@types/node'
+      - babel-plugin-macros
+      - supports-color
+      - ts-node
+    dev: true
+
   /create-jest@29.7.0(@types/node@20.11.6)(ts-node@10.9.2):
     resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==}
     engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -3903,11 +3917,9 @@ packages:
         optional: true
     dev: true
 
-  /deep-eql@4.1.3:
-    resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==}
+  /deep-eql@5.0.1:
+    resolution: {integrity: sha512-nwQCf6ne2gez3o1MxWifqkciwt0zhl0LO1/UwVu4uMBuPmflWM4oQ70XMqHqnBJA+nhzncaqL9HVL6KkHJ28lw==}
     engines: {node: '>=6'}
-    dependencies:
-      type-detect: 4.0.8
     dev: true
 
   /deep-is@0.1.4:
@@ -5615,6 +5627,34 @@ packages:
       - supports-color
     dev: true
 
+  /jest-cli@29.7.0(@types/node@20.11.5)(ts-node@10.9.2):
+    resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==}
+    engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+    hasBin: true
+    peerDependencies:
+      node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
+    peerDependenciesMeta:
+      node-notifier:
+        optional: true
+    dependencies:
+      '@jest/core': 29.7.0(ts-node@10.9.2)
+      '@jest/test-result': 29.7.0
+      '@jest/types': 29.6.3
+      chalk: 4.1.2
+      create-jest: 29.7.0(@types/node@20.11.5)(ts-node@10.9.2)
+      exit: 0.1.2
+      import-local: 3.1.0
+      jest-config: 29.7.0(@types/node@20.11.5)(ts-node@10.9.2)
+      jest-util: 29.7.0
+      jest-validate: 29.7.0
+      yargs: 17.7.2
+    transitivePeerDependencies:
+      - '@types/node'
+      - babel-plugin-macros
+      - supports-color
+      - ts-node
+    dev: true
+
   /jest-cli@29.7.0(@types/node@20.11.6)(ts-node@10.9.2):
     resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==}
     engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -5643,6 +5683,47 @@ packages:
       - ts-node
     dev: true
 
+  /jest-config@29.7.0(@types/node@20.11.5)(ts-node@10.9.2):
+    resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==}
+    engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+    peerDependencies:
+      '@types/node': '*'
+      ts-node: '>=9.0.0'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+      ts-node:
+        optional: true
+    dependencies:
+      '@babel/core': 7.23.2
+      '@jest/test-sequencer': 29.7.0
+      '@jest/types': 29.6.3
+      '@types/node': 20.11.5
+      babel-jest: 29.7.0(@babel/core@7.23.2)
+      chalk: 4.1.2
+      ci-info: 3.9.0
+      deepmerge: 4.3.1
+      glob: 7.2.3
+      graceful-fs: 4.2.11
+      jest-circus: 29.7.0
+      jest-environment-node: 29.7.0
+      jest-get-type: 29.6.3
+      jest-regex-util: 29.6.3
+      jest-resolve: 29.7.0
+      jest-runner: 29.7.0
+      jest-util: 29.7.0
+      jest-validate: 29.7.0
+      micromatch: 4.0.5
+      parse-json: 5.2.0
+      pretty-format: 29.7.0
+      slash: 3.0.0
+      strip-json-comments: 3.1.1
+      ts-node: 10.9.2(@types/node@20.11.5)(typescript@5.3.3)
+    transitivePeerDependencies:
+      - babel-plugin-macros
+      - supports-color
+    dev: true
+
   /jest-config@29.7.0(@types/node@20.11.6)(ts-node@10.9.2):
     resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==}
     engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -5967,6 +6048,27 @@ packages:
       supports-color: 8.1.1
     dev: true
 
+  /jest@29.7.0(@types/node@20.11.5)(ts-node@10.9.2):
+    resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==}
+    engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+    hasBin: true
+    peerDependencies:
+      node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
+    peerDependenciesMeta:
+      node-notifier:
+        optional: true
+    dependencies:
+      '@jest/core': 29.7.0(ts-node@10.9.2)
+      '@jest/types': 29.6.3
+      import-local: 3.1.0
+      jest-cli: 29.7.0(@types/node@20.11.5)(ts-node@10.9.2)
+    transitivePeerDependencies:
+      - '@types/node'
+      - babel-plugin-macros
+      - supports-color
+      - ts-node
+    dev: true
+
   /jest@29.7.0(@types/node@20.11.6)(ts-node@10.9.2):
     resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==}
     engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -6156,8 +6258,8 @@ packages:
       is-unicode-supported: 0.1.0
     dev: true
 
-  /loupe@2.3.7:
-    resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==}
+  /loupe@3.1.0:
+    resolution: {integrity: sha512-qKl+FrLXUhFuHUoDJG7f8P8gEMHq9NFS0c6ghXG1J0rldmZFQZoNVv/vyirE9qwCIhWZDsvEFd1sbFu3GvRQFg==}
     dependencies:
       get-func-name: 2.0.2
     dev: true
@@ -6694,8 +6796,9 @@ packages:
     engines: {node: '>=12'}
     dev: true
 
-  /pathval@1.1.1:
-    resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==}
+  /pathval@2.0.0:
+    resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==}
+    engines: {node: '>= 14.16'}
     dev: true
 
   /pause-stream@0.0.11:
@@ -7616,6 +7719,37 @@ packages:
       yargs-parser: 21.1.1
     dev: true
 
+  /ts-node@10.9.2(@types/node@20.11.5)(typescript@5.3.3):
+    resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
+    hasBin: true
+    peerDependencies:
+      '@swc/core': '>=1.2.50'
+      '@swc/wasm': '>=1.2.50'
+      '@types/node': '*'
+      typescript: '>=2.7'
+    peerDependenciesMeta:
+      '@swc/core':
+        optional: true
+      '@swc/wasm':
+        optional: true
+    dependencies:
+      '@cspotcode/source-map-support': 0.8.1
+      '@tsconfig/node10': 1.0.9
+      '@tsconfig/node12': 1.0.11
+      '@tsconfig/node14': 1.0.3
+      '@tsconfig/node16': 1.0.4
+      '@types/node': 20.11.5
+      acorn: 8.11.2
+      acorn-walk: 8.3.0
+      arg: 4.1.3
+      create-require: 1.1.1
+      diff: 4.0.2
+      make-error: 1.3.6
+      typescript: 5.3.3
+      v8-compile-cache-lib: 3.0.1
+      yn: 3.1.1
+    dev: true
+
   /ts-node@10.9.2(@types/node@20.11.6)(typescript@5.3.3):
     resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
     hasBin: true
diff --git a/token-group/js/package.json b/token-group/js/package.json
index 22b8bbd9e..c457434c8 100644
--- a/token-group/js/package.json
+++ b/token-group/js/package.json
@@ -60,7 +60,7 @@
         "@types/node": "^20.11.6",
         "@typescript-eslint/eslint-plugin": "^6.19.1",
         "@typescript-eslint/parser": "^6.19.1",
-        "chai": "^4.3.6",
+        "chai": "^5.0.0",
         "eslint": "^8.55.0",
         "eslint-config-prettier": "^9.1.0",
         "eslint-plugin-prettier": "^5.1.3",
diff --git a/token-metadata/js/package.json b/token-metadata/js/package.json
index e4d75d7b8..b501bf027 100644
--- a/token-metadata/js/package.json
+++ b/token-metadata/js/package.json
@@ -61,7 +61,7 @@
         "@types/node": "^20.11.6",
         "@typescript-eslint/eslint-plugin": "^6.19.1",
         "@typescript-eslint/parser": "^6.19.1",
-        "chai": "^4.3.6",
+        "chai": "^5.0.0",
         "eslint": "^8.56.0",
         "eslint-config-prettier": "^9.1.0",
         "eslint-plugin-prettier": "^5.1.3",
diff --git a/token/js/package.json b/token/js/package.json
index 9c566191e..b70e31c0f 100644
--- a/token/js/package.json
+++ b/token/js/package.json
@@ -70,7 +70,7 @@
         "@types/node-fetch": "^2.6.11",
         "@typescript-eslint/eslint-plugin": "^6.19.1",
         "@typescript-eslint/parser": "^6.19.1",
-        "chai": "^4.3.6",
+        "chai": "^5.0.0",
         "chai-as-promised": "^7.1.1",
         "eslint": "^8.56.0",
         "eslint-config-prettier": "^9.1.0",


Test patch:
diff --git a/account-compression/sdk/tests/accountCompression.test.ts b/account-compression/sdk/tests/accountCompression.test.ts
index 86d741e63..fa48ea0ac 100644
--- a/account-compression/sdk/tests/accountCompression.test.ts
+++ b/account-compression/sdk/tests/accountCompression.test.ts
@@ -1,8 +1,9 @@
+import { strict as assert } from 'node:assert';
+
 import { AnchorProvider } from '@project-serum/anchor';
 import NodeWallet from '@project-serum/anchor/dist/cjs/nodewallet';
 import { Connection, Keypair, PublicKey, TransactionInstruction } from '@solana/web3.js';
 import { BN } from 'bn.js';
-import { assert } from 'chai';
 import * as crypto from 'crypto';
 
 import {
diff --git a/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts b/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts
index f7f9799b2..b3d794ad7 100644
--- a/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts
+++ b/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts
@@ -1,7 +1,8 @@
+import { strict as assert } from 'node:assert';
+
 import { AnchorProvider } from '@project-serum/anchor';
 import NodeWallet from '@project-serum/anchor/dist/cjs/nodewallet';
 import { Connection, Keypair, PublicKey } from '@solana/web3.js';
-import { assert } from 'chai';
 
 import { ALL_DEPTH_SIZE_PAIRS, ConcurrentMerkleTreeAccount, getConcurrentMerkleTreeAccountSize } from '../../src';
 import { emptyNode, MerkleTree } from '../../src/merkle-tree';
diff --git a/account-compression/sdk/tests/events/applicationData.test.ts b/account-compression/sdk/tests/events/applicationData.test.ts
index f71521b63..04542921f 100644
--- a/account-compression/sdk/tests/events/applicationData.test.ts
+++ b/account-compression/sdk/tests/events/applicationData.test.ts
@@ -1,5 +1,6 @@
+import { strict as assert } from "node:assert";
+
 import { BN } from "bn.js";
-import { assert } from "chai";
 
 import { deserializeApplicationDataEvent } from "../../src";
 
diff --git a/account-compression/sdk/tests/events/changelog.test.ts b/account-compression/sdk/tests/events/changelog.test.ts
index 807ad0eb6..aa432493d 100644
--- a/account-compression/sdk/tests/events/changelog.test.ts
+++ b/account-compression/sdk/tests/events/changelog.test.ts
@@ -1,9 +1,10 @@
+import { strict as assert } from "node:assert";
+
 import { AnchorProvider } from "@project-serum/anchor";
 import NodeWallet from "@project-serum/anchor/dist/cjs/nodewallet";
 import { bs58 } from "@project-serum/anchor/dist/cjs/utils/bytes";
 import { Connection, Keypair, PublicKey } from "@solana/web3.js";
 import { BN } from "bn.js";
-import { assert } from "chai";
 import * as crypto from "crypto";
 
 import {
diff --git a/account-compression/sdk/tests/merkleTree.test.ts b/account-compression/sdk/tests/merkleTree.test.ts
index 68f177066..f2e4814f3 100644
--- a/account-compression/sdk/tests/merkleTree.test.ts
+++ b/account-compression/sdk/tests/merkleTree.test.ts
@@ -1,4 +1,5 @@
-import { assert } from "chai";
+import { strict as assert } from "node:assert";
+
 import * as crypto from "crypto";
 
 import { emptyNode, MerkleTree } from "../src";
diff --git a/name-service/js/test/e2e/index.test.ts b/name-service/js/test/e2e/index.test.ts
index 820e7f0db..570dc04eb 100644
--- a/name-service/js/test/e2e/index.test.ts
+++ b/name-service/js/test/e2e/index.test.ts
@@ -6,8 +6,7 @@ import {
   sendAndConfirmTransaction,
   Transaction,
 } from '@solana/web3.js';
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
+import { beforeAll, beforeEach, describe, expect, test } from '@jest/globals';
 
 import {
   createNameRegistry,
@@ -20,101 +19,97 @@ import {
   updateNameRegistryData,
 } from '../../src';
 
-chai.use(chaiAsPromised);
 const url = 'http://127.0.0.1:8899';
-
-describe('Name Service Program', async () => {
-  const connection = new Connection(url, 'confirmed');
-  const payer = Keypair.generate();
-  const owner = Keypair.generate();
-  const space = 20;
-  let nameKey: PublicKey;
-  let name: string;
-  before(async () => {
-    const airdropSignature = await connection.requestAirdrop(
-      payer.publicKey,
-      LAMPORTS_PER_SOL,
-    );
-    await connection.confirmTransaction({
-      signature: airdropSignature,
-      ...(await connection.getLatestBlockhash()),
-    });
+const connection = new Connection(url, 'confirmed');
+const payer = Keypair.generate();
+const owner = Keypair.generate();
+const space = 20;
+let nameKey: PublicKey;
+let name: string;
+beforeAll(async () => {
+  const airdropSignature = await connection.requestAirdrop(
+    payer.publicKey,
+    LAMPORTS_PER_SOL,
+  );
+  await connection.confirmTransaction({
+    signature: airdropSignature,
+    ...(await connection.getLatestBlockhash()),
   });
+});
 
-  beforeEach(async () => {
-    name = Math.random().toString() + '.sol';
-    nameKey = await getNameKey(name);
-    const lamports = await connection.getMinimumBalanceForRentExemption(
-      space + NameRegistryState.HEADER_LEN,
-    );
-    const inst = await createNameRegistry(
-      connection,
-      name,
-      space,
-      payer.publicKey,
-      owner.publicKey,
-      lamports,
-    );
-    const tx = new Transaction().add(inst);
-    await sendAndConfirmTransaction(connection, tx, [payer]);
-  });
+beforeEach(async () => {
+  name = Math.random().toString() + '.sol';
+  nameKey = await getNameKey(name);
+  const lamports = await connection.getMinimumBalanceForRentExemption(
+    space + NameRegistryState.HEADER_LEN,
+  );
+  const inst = await createNameRegistry(
+    connection,
+    name,
+    space,
+    payer.publicKey,
+    owner.publicKey,
+    lamports,
+  );
+  const tx = new Transaction().add(inst);
+  await sendAndConfirmTransaction(connection, tx, [payer]);
+});
 
-  it('Create Name Registery', async () => {
-    const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
-    nameAccount.owner.equals(owner.publicKey);
-    expect(nameAccount.data?.length).to.eql(space);
-  });
-  it('Update Name Registery', async () => {
-    const data = Buffer.from('@Dudl');
-    const inst = await updateNameRegistryData(connection, name, 0, data);
-    const tx = new Transaction().add(inst);
-    await sendAndConfirmTransaction(connection, tx, [payer, owner]);
-    const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
-    nameAccount.data?.equals(data);
-  });
-  it('Transfer Name Ownership', async () => {
-    const newOwner = Keypair.generate();
-    const inst = await transferNameOwnership(
-      connection,
-      name,
-      newOwner.publicKey,
-    );
-    const tx = new Transaction().add(inst);
-    await sendAndConfirmTransaction(connection, tx, [payer, owner]);
-    const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
-    nameAccount.owner.equals(newOwner.publicKey);
-  });
-  it('Realloc Name Account to bigger space', async () => {
-    const inst = await reallocNameAccount(
-      connection,
-      name,
-      space + 10,
-      payer.publicKey,
-    );
-    const tx = new Transaction().add(inst);
-    await sendAndConfirmTransaction(connection, tx, [payer, owner]);
-    const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
-    expect(nameAccount.data?.length).to.eql(space + 10);
-  });
-  it('Realloc Name Account to smaller space', async () => {
-    const inst = await reallocNameAccount(
-      connection,
-      name,
-      space - 10,
-      payer.publicKey,
-    );
-    const tx = new Transaction().add(inst);
-    await sendAndConfirmTransaction(connection, tx, [payer, owner]);
-    const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
-    expect(nameAccount.data?.length).to.eql(space - 10);
-  });
-  it('Delete Name Registry', async () => {
-    const inst = await deleteNameRegistry(connection, name, payer.publicKey);
-    const tx = new Transaction().add(inst);
-    await sendAndConfirmTransaction(connection, tx, [payer, owner]);
-    const nameAccount = await connection.getAccountInfo(nameKey);
-    expect(nameAccount).to.be.null;
-  });
+test('Create Name Registery', async () => {
+  const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
+  nameAccount.owner.equals(owner.publicKey);
+  expect(nameAccount.data?.length).toEqual(space);
+});
+test('Update Name Registery', async () => {
+  const data = Buffer.from('@Dudl');
+  const inst = await updateNameRegistryData(connection, name, 0, data);
+  const tx = new Transaction().add(inst);
+  await sendAndConfirmTransaction(connection, tx, [payer, owner]);
+  const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
+  nameAccount.data?.equals(data);
+});
+test('Transfer Name Ownership', async () => {
+  const newOwner = Keypair.generate();
+  const inst = await transferNameOwnership(
+    connection,
+    name,
+    newOwner.publicKey,
+  );
+  const tx = new Transaction().add(inst);
+  await sendAndConfirmTransaction(connection, tx, [payer, owner]);
+  const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
+  nameAccount.owner.equals(newOwner.publicKey);
+});
+test('Realloc Name Account to bigger space', async () => {
+  const inst = await reallocNameAccount(
+    connection,
+    name,
+    space + 10,
+    payer.publicKey,
+  );
+  const tx = new Transaction().add(inst);
+  await sendAndConfirmTransaction(connection, tx, [payer, owner]);
+  const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
+  expect(nameAccount.data?.length).toEqual(space + 10);
+});
+test('Realloc Name Account to smaller space', async () => {
+  const inst = await reallocNameAccount(
+    connection,
+    name,
+    space - 10,
+    payer.publicKey,
+  );
+  const tx = new Transaction().add(inst);
+  await sendAndConfirmTransaction(connection, tx, [payer, owner]);
+  const nameAccount = await NameRegistryState.retrieve(connection, nameKey);
+  expect(nameAccount.data?.length).toEqual(space - 10);
+});
+test('Delete Name Registry', async () => {
+  const inst = await deleteNameRegistry(connection, name, payer.publicKey);
+  const tx = new Transaction().add(inst);
+  await sendAndConfirmTransaction(connection, tx, [payer, owner]);
+  const nameAccount = await connection.getAccountInfo(nameKey);
+  expect(nameAccount).toBeNull;
 });
 
 const getNameKey = async (
diff --git a/name-service/js/test/unit/index.test.ts b/name-service/js/test/unit/index.test.ts
index 5cc2cc2c6..5ae8f81a7 100644
--- a/name-service/js/test/unit/index.test.ts
+++ b/name-service/js/test/unit/index.test.ts
@@ -4,8 +4,6 @@ import {
   PublicKey,
   SystemProgram,
 } from '@solana/web3.js';
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
 
 import {
   createInstruction,
@@ -16,7 +14,7 @@ import {
 } from '../../src';
 import { Numberu32, Numberu64 } from '../../src/utils';
 
-chai.use(chaiAsPromised);
+import { describe, expect, test } from '@jest/globals';
 
 describe('SplNameService Instructions', () => {
   const nameServiceAddress = new PublicKey(
@@ -30,7 +28,7 @@ describe('SplNameService Instructions', () => {
   const nameParentOwner = Keypair.generate().publicKey;
   const name = Buffer.from('hello');
 
-  it('createInstruction without class and parent name key', () => {
+  test('createInstruction without class and parent name key', () => {
     const instruction = createInstruction(
       nameServiceAddress,
       SystemProgram.programId,
@@ -42,7 +40,7 @@ describe('SplNameService Instructions', () => {
       new Numberu64(10),
     );
 
-    expect(instruction.keys).to.have.length(6);
+    expect(instruction.keys).toHaveLength(6);
     instruction.keys[0].pubkey.equals(SystemProgram.programId);
     instruction.keys[1].pubkey.equals(payerKey);
     instruction.keys[2].pubkey.equals(nameAccountKey);
@@ -51,7 +49,7 @@ describe('SplNameService Instructions', () => {
     instruction.keys[5].pubkey.equals(new PublicKey(Buffer.alloc(32)));
   });
 
-  it('createInstruction with class and parent name key', () => {
+  test('createInstruction with class and parent name key', () => {
     const instruction = createInstruction(
       nameServiceAddress,
       SystemProgram.programId,
@@ -66,7 +64,7 @@ describe('SplNameService Instructions', () => {
       nameParentOwner,
     );
 
-    expect(instruction.keys).to.have.length(7);
+    expect(instruction.keys).toHaveLength(7);
     instruction.keys[0].pubkey.equals(SystemProgram.programId);
     instruction.keys[1].pubkey.equals(payerKey);
     instruction.keys[2].pubkey.equals(nameAccountKey);
@@ -76,7 +74,7 @@ describe('SplNameService Instructions', () => {
     instruction.keys[6].pubkey.equals(nameParentOwner);
   });
 
-  it('updateInstruction', () => {
+  test('updateInstruction', () => {
     const data = Buffer.from('@Dudl');
     const instruction = updateInstruction(
       nameServiceAddress,
@@ -87,12 +85,12 @@ describe('SplNameService Instructions', () => {
       undefined,
     );
 
-    expect(instruction.keys).to.have.length(2);
+    expect(instruction.keys).toHaveLength(2);
     instruction.keys[0].pubkey.equals(nameAccountKey);
     instruction.keys[1].pubkey.equals(nameOwnerKey);
   });
 
-  it('transferInstruction', () => {
+  test('transferInstruction', () => {
     const newOwner = Keypair.generate().publicKey;
     const instruction = transferInstruction(
       nameServiceAddress,
@@ -101,12 +99,12 @@ describe('SplNameService Instructions', () => {
       nameOwnerKey,
     );
 
-    expect(instruction.keys).to.have.length(2);
+    expect(instruction.keys).toHaveLength(2);
     instruction.keys[0].pubkey.equals(nameAccountKey);
     instruction.keys[1].pubkey.equals(nameOwnerKey);
   });
 
-  it('deleteInstruction', () => {
+  test('deleteInstruction', () => {
     const instruction = deleteInstruction(
       nameServiceAddress,
       nameAccountKey,
@@ -114,13 +112,13 @@ describe('SplNameService Instructions', () => {
       nameOwnerKey,
     );
 
-    expect(instruction.keys).to.have.length(3);
+    expect(instruction.keys).toHaveLength(3);
     instruction.keys[0].pubkey.equals(nameAccountKey);
     instruction.keys[1].pubkey.equals(nameOwnerKey);
     instruction.keys[2].pubkey.equals(payerKey);
   });
 
-  it('reallocInstruction', () => {
+  test('reallocInstruction', () => {
     const instruction = reallocInstruction(
       nameServiceAddress,
       SystemProgram.programId,
@@ -130,7 +128,7 @@ describe('SplNameService Instructions', () => {
       new Numberu32(30),
     );
 
-    expect(instruction.keys).to.have.length(4);
+    expect(instruction.keys).toHaveLength(4);
     instruction.keys[0].pubkey.equals(SystemProgram.programId);
     instruction.keys[1].pubkey.equals(payerKey);
     instruction.keys[2].pubkey.equals(nameAccountKey);
diff --git a/token/js/test/e2e-2022/closeMint.test.ts b/token/js/test/e2e-2022/closeMint.test.ts
index f6610a9c2..0fabd6506 100644
--- a/token/js/test/e2e-2022/closeMint.test.ts
+++ b/token/js/test/e2e-2022/closeMint.test.ts
@@ -1,6 +1,6 @@
-import chai, { expect } from 'chai';
+import { expect, use } from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
+use(chaiAsPromised);
 
 import type { Connection, Signer } from '@solana/web3.js';
 import { PublicKey } from '@solana/web3.js';
diff --git a/token/js/test/e2e-2022/cpiGuard.test.ts b/token/js/test/e2e-2022/cpiGuard.test.ts
index 18793ad2a..3a0e8be3d 100644
--- a/token/js/test/e2e-2022/cpiGuard.test.ts
+++ b/token/js/test/e2e-2022/cpiGuard.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { sendAndConfirmTransaction, Keypair, SystemProgram, Transaction } from '@solana/web3.js';
 import {
diff --git a/token/js/test/e2e-2022/defaultAccountState.test.ts b/token/js/test/e2e-2022/defaultAccountState.test.ts
index eb969ef15..f0118adbc 100644
--- a/token/js/test/e2e-2022/defaultAccountState.test.ts
+++ b/token/js/test/e2e-2022/defaultAccountState.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { sendAndConfirmTransaction, Keypair, SystemProgram, Transaction } from '@solana/web3.js';
 import {
diff --git a/token/js/test/e2e-2022/immutableOwner.test.ts b/token/js/test/e2e-2022/immutableOwner.test.ts
index 4ecf11856..f45c92444 100644
--- a/token/js/test/e2e-2022/immutableOwner.test.ts
+++ b/token/js/test/e2e-2022/immutableOwner.test.ts
@@ -1,6 +1,6 @@
-import chai, { expect } from 'chai';
+import { expect, use } from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
+use(chaiAsPromised);
 
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair, SystemProgram, Transaction, sendAndConfirmTransaction } from '@solana/web3.js';
diff --git a/token/js/test/e2e-2022/interestBearingMint.test.ts b/token/js/test/e2e-2022/interestBearingMint.test.ts
index 6da251477..94e9349dc 100644
--- a/token/js/test/e2e-2022/interestBearingMint.test.ts
+++ b/token/js/test/e2e-2022/interestBearingMint.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, Signer } from '@solana/web3.js';
 import { PublicKey } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
diff --git a/token/js/test/e2e-2022/memoTransfer.test.ts b/token/js/test/e2e-2022/memoTransfer.test.ts
index 359ece833..2c78c2d08 100644
--- a/token/js/test/e2e-2022/memoTransfer.test.ts
+++ b/token/js/test/e2e-2022/memoTransfer.test.ts
@@ -1,6 +1,6 @@
-import chai, { expect } from 'chai';
+import { expect, use } from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
+use(chaiAsPromised);
 
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { sendAndConfirmTransaction, Keypair, SystemProgram, Transaction } from '@solana/web3.js';
diff --git a/token/js/test/e2e-2022/nonTransferableMint.test.ts b/token/js/test/e2e-2022/nonTransferableMint.test.ts
index 8d436a5f0..2d0698e28 100644
--- a/token/js/test/e2e-2022/nonTransferableMint.test.ts
+++ b/token/js/test/e2e-2022/nonTransferableMint.test.ts
@@ -1,6 +1,6 @@
-import chai, { expect } from 'chai';
+import { expect, use } from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
+use(chaiAsPromised);
 
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { sendAndConfirmTransaction, Keypair, SystemProgram, Transaction } from '@solana/web3.js';
diff --git a/token/js/test/e2e-2022/permanentDelegate.test.ts b/token/js/test/e2e-2022/permanentDelegate.test.ts
index 802518a51..b6ac28eb6 100644
--- a/token/js/test/e2e-2022/permanentDelegate.test.ts
+++ b/token/js/test/e2e-2022/permanentDelegate.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, Signer } from '@solana/web3.js';
 import { PublicKey } from '@solana/web3.js';
 import { sendAndConfirmTransaction, Keypair, SystemProgram, Transaction } from '@solana/web3.js';
diff --git a/token/js/test/e2e-2022/reallocate.test.ts b/token/js/test/e2e-2022/reallocate.test.ts
index 4ce16d721..d36563954 100644
--- a/token/js/test/e2e-2022/reallocate.test.ts
+++ b/token/js/test/e2e-2022/reallocate.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair, Transaction, sendAndConfirmTransaction } from '@solana/web3.js';
 
diff --git a/token/js/test/e2e-2022/tlv.test.ts b/token/js/test/e2e-2022/tlv.test.ts
index 7f7cea6dd..a4bcc5e44 100644
--- a/token/js/test/e2e-2022/tlv.test.ts
+++ b/token/js/test/e2e-2022/tlv.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { sendAndConfirmTransaction, Keypair, SystemProgram, Transaction } from '@solana/web3.js';
 
diff --git a/token/js/test/e2e-2022/tokenMetadata.test.ts b/token/js/test/e2e-2022/tokenMetadata.test.ts
index b66c945a2..b98bce9a2 100644
--- a/token/js/test/e2e-2022/tokenMetadata.test.ts
+++ b/token/js/test/e2e-2022/tokenMetadata.test.ts
@@ -1,6 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-
+import { expect } from 'chai';
 import { getBase64Encoder } from '@solana/codecs-strings';
 import { createEmitInstruction, pack } from '@solana/spl-token-metadata';
 import {
@@ -29,8 +27,6 @@ import {
 } from '../../src';
 import { TEST_PROGRAM_ID, newAccountWithLamports, getConnection } from '../common';
 
-chai.use(chaiAsPromised);
-
 const TEST_TOKEN_DECIMALS = 2;
 const EXTENSIONS = [ExtensionType.MetadataPointer];
 
diff --git a/token/js/test/e2e-2022/transferFee.test.ts b/token/js/test/e2e-2022/transferFee.test.ts
index e007ce36a..7a0944c13 100644
--- a/token/js/test/e2e-2022/transferFee.test.ts
+++ b/token/js/test/e2e-2022/transferFee.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, Signer } from '@solana/web3.js';
 import { PublicKey } from '@solana/web3.js';
 import { Keypair, SystemProgram, Transaction, sendAndConfirmTransaction } from '@solana/web3.js';
diff --git a/token/js/test/e2e-2022/transferHook.test.ts b/token/js/test/e2e-2022/transferHook.test.ts
index 58d16af24..717c94033 100644
--- a/token/js/test/e2e-2022/transferHook.test.ts
+++ b/token/js/test/e2e-2022/transferHook.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { AccountMeta, Connection, Signer } from '@solana/web3.js';
 import { PublicKey, TransactionInstruction } from '@solana/web3.js';
 import { sendAndConfirmTransaction, Keypair, SystemProgram, Transaction } from '@solana/web3.js';
diff --git a/token/js/test/e2e/amount.test.ts b/token/js/test/e2e/amount.test.ts
index 2590869d3..a8e0c0d8c 100644
--- a/token/js/test/e2e/amount.test.ts
+++ b/token/js/test/e2e/amount.test.ts
@@ -1,12 +1,9 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
+import { expect } from 'chai';
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
 import { createMint, amountToUiAmount, uiAmountToAmount } from '../../src';
 import { TEST_PROGRAM_ID, newAccountWithLamports, getConnection } from '../common';
 
-chai.use(chaiAsPromised);
-
 const TEST_TOKEN_DECIMALS = 2;
 describe('Amount', () => {
     let connection: Connection;
diff --git a/token/js/test/e2e/burn.test.ts b/token/js/test/e2e/burn.test.ts
index 72ecdf73e..4b0c4e23f 100644
--- a/token/js/test/e2e/burn.test.ts
+++ b/token/js/test/e2e/burn.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
 import { createMint, createAccount, getAccount, mintTo, burn, burnChecked } from '../../src';
diff --git a/token/js/test/e2e/close.test.ts b/token/js/test/e2e/close.test.ts
index 5b1391c38..6d03a6ccf 100644
--- a/token/js/test/e2e/close.test.ts
+++ b/token/js/test/e2e/close.test.ts
@@ -1,11 +1,10 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect, use } from 'chai';
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
 import { createMint, createAccount, closeAccount, mintTo } from '../../src';
 import { TEST_PROGRAM_ID, newAccountWithLamports, getConnection } from '../common';
+import chaiAsPromised from 'chai-as-promised';
+use(chaiAsPromised);
 
 const TEST_TOKEN_DECIMALS = 2;
 describe('close', () => {
diff --git a/token/js/test/e2e/create.test.ts b/token/js/test/e2e/create.test.ts
index b6e177314..5d16638e6 100644
--- a/token/js/test/e2e/create.test.ts
+++ b/token/js/test/e2e/create.test.ts
@@ -1,10 +1,6 @@
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
 
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
 import {
     ASSOCIATED_TOKEN_PROGRAM_ID,
     createMint,
@@ -17,6 +13,9 @@ import {
 } from '../../src';
 
 import { TEST_PROGRAM_ID, newAccountWithLamports, getConnection } from '../common';
+import { expect, use } from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+use(chaiAsPromised);
 
 const TEST_TOKEN_DECIMALS = 2;
 describe('createMint', () => {
diff --git a/token/js/test/e2e/freeze.test.ts b/token/js/test/e2e/freeze.test.ts
index 69cbaf39a..1b5a4ea82 100644
--- a/token/js/test/e2e/freeze.test.ts
+++ b/token/js/test/e2e/freeze.test.ts
@@ -1,12 +1,11 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
 
 import { burn, createMint, createAccount, getAccount, freezeAccount, thawAccount, mintTo } from '../../src';
 import { TEST_PROGRAM_ID, newAccountWithLamports, getConnection } from '../common';
+import { expect, use } from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+use(chaiAsPromised);
 
 const TEST_TOKEN_DECIMALS = 2;
 describe('freezeThaw', () => {
diff --git a/token/js/test/e2e/mint.test.ts b/token/js/test/e2e/mint.test.ts
index 10912fcfe..750e63bed 100644
--- a/token/js/test/e2e/mint.test.ts
+++ b/token/js/test/e2e/mint.test.ts
@@ -1,13 +1,12 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
 
 import { createMint, getMint, createAccount, getAccount, mintTo, mintToChecked } from '../../src';
 
 import { TEST_PROGRAM_ID, newAccountWithLamports, getConnection } from '../common';
+import { expect, use } from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+use(chaiAsPromised);
 
 const TEST_TOKEN_DECIMALS = 2;
 describe('mint', () => {
diff --git a/token/js/test/e2e/multisig.test.ts b/token/js/test/e2e/multisig.test.ts
index 6217f8a9f..e66dd7fcf 100644
--- a/token/js/test/e2e/multisig.test.ts
+++ b/token/js/test/e2e/multisig.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
 
diff --git a/token/js/test/e2e/native.test.ts b/token/js/test/e2e/native.test.ts
index 5cf43a58e..95805e27d 100644
--- a/token/js/test/e2e/native.test.ts
+++ b/token/js/test/e2e/native.test.ts
@@ -1,7 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
+import { expect } from 'chai';
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair, Transaction, SystemProgram, sendAndConfirmTransaction } from '@solana/web3.js';
 import {
diff --git a/token/js/test/e2e/recoverNested.test.ts b/token/js/test/e2e/recoverNested.test.ts
index 6630b2279..09a1697ea 100644
--- a/token/js/test/e2e/recoverNested.test.ts
+++ b/token/js/test/e2e/recoverNested.test.ts
@@ -1,9 +1,6 @@
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair, Transaction, sendAndConfirmTransaction } from '@solana/web3.js';
-
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
+import { expect } from 'chai';
 
 import {
     ASSOCIATED_TOKEN_PROGRAM_ID,
diff --git a/token/js/test/e2e/setAuthority.test.ts b/token/js/test/e2e/setAuthority.test.ts
index f5c931907..5dac03f4e 100644
--- a/token/js/test/e2e/setAuthority.test.ts
+++ b/token/js/test/e2e/setAuthority.test.ts
@@ -1,13 +1,12 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
 
 import { AuthorityType, createMint, createAccount, getAccount, getMint, setAuthority } from '../../src';
 
 import { TEST_PROGRAM_ID, newAccountWithLamports, getConnection } from '../common';
+import { expect, use } from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+use(chaiAsPromised);
 
 const TEST_TOKEN_DECIMALS = 2;
 describe('setAuthority', () => {
diff --git a/token/js/test/e2e/transfer.test.ts b/token/js/test/e2e/transfer.test.ts
index ae82527c4..2796118c4 100644
--- a/token/js/test/e2e/transfer.test.ts
+++ b/token/js/test/e2e/transfer.test.ts
@@ -1,7 +1,3 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
 import type { Connection, PublicKey, Signer } from '@solana/web3.js';
 import { Keypair } from '@solana/web3.js';
 
@@ -18,6 +14,9 @@ import {
 } from '../../src';
 
 import { TEST_PROGRAM_ID, newAccountWithLamports, getConnection } from '../common';
+import { expect, use } from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+use(chaiAsPromised);
 
 const TEST_TOKEN_DECIMALS = 2;
 describe('transfer', () => {
diff --git a/token/js/test/unit/decode.test.ts b/token/js/test/unit/decode.test.ts
index 055bf459e..97602083d 100644
--- a/token/js/test/unit/decode.test.ts
+++ b/token/js/test/unit/decode.test.ts
@@ -1,14 +1,11 @@
 import { Keypair } from '@solana/web3.js';
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
+import { expect } from 'chai';
 import {
     createInitializeMintCloseAuthorityInstruction,
     createInitializePermanentDelegateInstruction,
     TOKEN_2022_PROGRAM_ID,
 } from '../../src';
 
-chai.use(chaiAsPromised);
-
 describe('spl-token-2022 instructions', () => {
     it('InitializeMintCloseAuthority', () => {
         const ix = createInitializeMintCloseAuthorityInstruction(
diff --git a/token/js/test/unit/index.test.ts b/token/js/test/unit/index.test.ts
index 4ece186fd..f1a5c7b4f 100644
--- a/token/js/test/unit/index.test.ts
+++ b/token/js/test/unit/index.test.ts
@@ -1,6 +1,5 @@
 import { Keypair, PublicKey } from '@solana/web3.js';
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
+import { expect, use } from 'chai';
 import {
     ASSOCIATED_TOKEN_PROGRAM_ID,
     createAssociatedTokenAccountInstruction,
@@ -25,8 +24,8 @@ import {
     createUiAmountToAmountInstruction,
     getMintLen,
 } from '../../src';
-
-chai.use(chaiAsPromised);
+import chaiAsPromised from 'chai-as-promised';
+use(chaiAsPromised);
 
 describe('spl-token instructions', () => {
     it('TransferChecked', () => {
diff --git a/token/js/test/unit/programId.test.ts b/token/js/test/unit/programId.test.ts
index e9a435b85..3ea894cce 100644
--- a/token/js/test/unit/programId.test.ts
+++ b/token/js/test/unit/programId.test.ts
@@ -1,5 +1,4 @@
-import chai, { expect } from 'chai';
-import chaiAsPromised from 'chai-as-promised';
+import { expect } from 'chai';
 import { PublicKey } from '@solana/web3.js';
 import {
     AccountState,
@@ -18,7 +17,6 @@ import {
     createEnableCpiGuardInstruction,
     createInitializeTransferHookInstruction,
 } from '../../src';
-chai.use(chaiAsPromised);
 
 describe('unsupported extensions in spl-token', () => {
     const mint = new PublicKey('7o36UsWR1JQLpZ9PE2gn9L4SQ69CNNiWAXd4Jt7rqz9Z');
diff --git a/token/js/test/unit/transferHook.test.ts b/token/js/test/unit/transferHook.test.ts
index 7dc3dee30..a943f752f 100644
--- a/token/js/test/unit/transferHook.test.ts
+++ b/token/js/test/unit/transferHook.test.ts
@@ -17,10 +17,12 @@ import {
     getExtraAccountMetas,
     resolveExtraAccountMeta,
 } from '../../src';
-import { expect } from 'chai';
+import { expect, use } from 'chai';
+import chaiAsPromised from 'chai-as-promised';
 import type { Connection } from '@solana/web3.js';
 import { Keypair, PublicKey, TransactionInstruction } from '@solana/web3.js';
 import { getConnection } from '../common';
+use(chaiAsPromised);
 
 describe('transferHook', () => {
     describe('validation data', () => {