feat: add testing to create-fuels
#12796
Annotations
16 errors
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts:
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts#L3
Error: [vitest] queueMock is not implemented in browser environment yet.
❯ packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts:3:4
|
browser
Process completed with exit code 1.
|
packages/create-fuels/test/cli.test.ts > CLI > should rewrite for the appropriate package manager:
packages/create-fuels/src/cli.ts#L131
Error: ENOENT: no such file or directory, lstat '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/.next/cache/config.json'
❯ Module.runScaffoldCli packages/create-fuels/src/cli.ts:131:3
❯ packages/create-fuels/test/cli.test.ts:78:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'lstat', path: '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/.next/cache/config.json' }
|
packages/fuel-gauge/src/transaction-response.test.ts > TransactionResponse > should throw error for a SqueezedOut status update [waitForResult]:
packages/errors/src/test-utils/safeExec.ts#L102
Error: Passed-in lambda didn't throw.
❯ Module.expectToThrowFuelError packages/errors/src/test-utils/safeExec.ts:102:11
❯ packages/fuel-gauge/src/transaction-response.test.ts:238:5
|
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts > rewriteTemplateFiles > should rewrite the package.json:
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts#L48
AssertionError: expected '{\n "name": "template-nextjs",\n "v…' to contain '"fuels": "^0.0.0"'
- Expected
+ Received
- "fuels": "^0.0.0"
+ {
+ "name": "template-nextjs",
+ "version": "0.1.3",
+ "private": true,
+ "scripts": {
+ "prebuild": "fuels build",
+ "fuels:dev": "fuels dev",
+ "dev": "next dev",
+ "build": "pnpm run prebuild && next build",
+ "start": "next start",
+ "lint": "next lint",
+ "test": "vitest"
+ },
+ "dependencies": {
+ "@fuels/connectors": "^0.8.1",
+ "@fuels/react": "^0.20.0",
+ "fuels": "0.92.0",
+ "@tanstack/react-query": "^5.29.2",
+ "dotenv": "^16.4.5",
+ "next": "14.2.4",
+ "react": "^18.3",
+ "react-dom": "^18.3",
+ "react-hot-toast": "^2.4.1",
+ "react-use": "^17.5.0"
+ },
+ "devDependencies": {
+ "@types/node": "^20",
+ "@types/react": "^18.3",
+ "@types/react-dom": "^18.3",
+ "autoprefixer": "^10.4.19",
+ "eslint": "^8",
+ "eslint-config-next": "14.2.4",
+ "postcss": "^8",
+ "tailwindcss": "^3.4.4",
+ "typescript": "~5.4.5",
+ "vitest": "^1.6.0"
+ }
+ }
+
❯ packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts:48:25
|
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts > rewriteTemplateFiles > should rewrite the test files:
packages/create-fuels/src/lib/rewriteTemplateFiles.ts#L23
Error: ENOENT: no such file or directory, open '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/fuels.config.ts'
❯ Proxy.readFileSync node:fs:448:20
❯ Module.rewriteTemplateFiles packages/create-fuels/src/lib/rewriteTemplateFiles.ts:23:9
❯ packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts:79:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/fuels.config.ts' }
|
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts > rewriteTemplateFiles > should rewrite the test files:
packages/create-fuels/test/utils/bootstrapProject.ts#L57
Error: ENOTEMPTY: directory not empty, rmdir '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/.next'
❯ Object.rmdirSync node:fs:1217:11
❯ Proxy.rmSync node:fs:1266:10
❯ Module.resetFilesystem packages/create-fuels/test/utils/bootstrapProject.ts:57:5
❯ packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts:32:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -39, code: 'ENOTEMPTY', syscall: 'rmdir', path: '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/.next' }
|
node@22
Process completed with exit code 1.
|
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts > rewriteTemplateFiles > should rewrite the package.json:
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts#L48
AssertionError: expected '{\n "name": "template-nextjs",\n "v…' to contain '"fuels": "^0.0.0"'
- Expected
+ Received
- "fuels": "^0.0.0"
+ {
+ "name": "template-nextjs",
+ "version": "0.1.3",
+ "private": true,
+ "scripts": {
+ "prebuild": "fuels build",
+ "fuels:dev": "fuels dev",
+ "dev": "next dev",
+ "build": "pnpm run prebuild && next build",
+ "start": "next start",
+ "lint": "next lint",
+ "test": "vitest"
+ },
+ "dependencies": {
+ "@fuels/connectors": "^0.8.1",
+ "@fuels/react": "^0.20.0",
+ "fuels": "0.92.0",
+ "@tanstack/react-query": "^5.29.2",
+ "dotenv": "^16.4.5",
+ "next": "14.2.4",
+ "react": "^18.3",
+ "react-dom": "^18.3",
+ "react-hot-toast": "^2.4.1",
+ "react-use": "^17.5.0"
+ },
+ "devDependencies": {
+ "@types/node": "^20",
+ "@types/react": "^18.3",
+ "@types/react-dom": "^18.3",
+ "autoprefixer": "^10.4.19",
+ "eslint": "^8",
+ "eslint-config-next": "14.2.4",
+ "postcss": "^8",
+ "tailwindcss": "^3.4.4",
+ "typescript": "~5.4.5",
+ "vitest": "^1.6.0"
+ }
+ }
+
❯ packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts:48:25
|
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts > rewriteTemplateFiles > should rewrite the fuels.config.ts:
packages/create-fuels/src/lib/rewriteTemplateFiles.ts#L23
Error: ENOENT: no such file or directory, open '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/fuels.config.ts'
❯ Proxy.readFileSync node:fs:448:20
❯ Module.rewriteTemplateFiles packages/create-fuels/src/lib/rewriteTemplateFiles.ts:23:9
❯ packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts:54:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/fuels.config.ts' }
|
node@20
Process completed with exit code 1.
|
packages/create-fuels/test/cli.test.ts > CLI > should rewrite for the appropriate package manager:
packages/create-fuels/test/utils/bootstrapProject.ts#L57
Error: ENOTEMPTY: directory not empty, rmdir '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/sway-programs'
❯ Object.rmdirSync node:fs:1222:10
❯ Proxy.rmSync node:fs:1271:10
❯ Module.resetFilesystem packages/create-fuels/test/utils/bootstrapProject.ts:57:5
❯ packages/create-fuels/test/cli.test.ts:33:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -39, syscall: 'rmdir', code: 'ENOTEMPTY', path: '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/sway-programs' }
|
packages/create-fuels/test/cli.test.ts > CLI > create-fuels reports an error if the project directory already exists:
packages/create-fuels/src/lib/rewriteTemplateFiles.ts#L13
Error: ENOENT: no such file or directory, open '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/package.json'
❯ Object.openSync node:fs:596:3
❯ Proxy.readFileSync node:fs:464:35
❯ Module.rewriteTemplateFiles packages/create-fuels/src/lib/rewriteTemplateFiles.ts:13:17
❯ Module.copyTemplate packages/create-fuels/test/utils/bootstrapProject.ts:51:5
❯ packages/create-fuels/test/cli.test.ts:28:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -2, syscall: 'open', code: 'ENOENT', path: '/home/runner/work/fuels-ts/fuels-ts/packages/create-fuels/templates/nextjs/package.json' }
|
packages/fuel-gauge/src/token-test-contract.test.ts > TokenTestContract > Contract getBalance:
packages/fuel-gauge/src/token-test-contract.test.ts#L159
AssertionError: expected '0x64' to deeply equal '0x32'
- Expected
+ Received
- 0x32
+ 0x64
❯ packages/fuel-gauge/src/token-test-contract.test.ts:159:42
|
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts > rewriteTemplateFiles > should rewrite the package.json:
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts#L48
AssertionError: expected '{\n "name": "template-nextjs",\n "v…' to contain '"fuels": "^0.0.0"'
- Expected
+ Received
- "fuels": "^0.0.0"
+ {
+ "name": "template-nextjs",
+ "version": "0.1.3",
+ "private": true,
+ "scripts": {
+ "prebuild": "fuels build",
+ "fuels:dev": "fuels dev",
+ "dev": "next dev",
+ "build": "pnpm run prebuild && next build",
+ "start": "next start",
+ "lint": "next lint",
+ "test": "vitest"
+ },
+ "dependencies": {
+ "@fuels/connectors": "^0.8.1",
+ "@fuels/react": "^0.20.0",
+ "fuels": "0.92.0",
+ "@tanstack/react-query": "^5.29.2",
+ "dotenv": "^16.4.5",
+ "next": "14.2.4",
+ "react": "^18.3",
+ "react-dom": "^18.3",
+ "react-hot-toast": "^2.4.1",
+ "react-use": "^17.5.0"
+ },
+ "devDependencies": {
+ "@types/node": "^20",
+ "@types/react": "^18.3",
+ "@types/react-dom": "^18.3",
+ "autoprefixer": "^10.4.19",
+ "eslint": "^8",
+ "eslint-config-next": "14.2.4",
+ "postcss": "^8",
+ "tailwindcss": "^3.4.4",
+ "typescript": "~5.4.5",
+ "vitest": "^1.6.0"
+ }
+ }
+
❯ packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts:48:25
|
node@18
Process completed with exit code 1.
|