Use import.meta.url instead of process.cwd() (#5675)

* Use import.meta.url instead of process.cwd()

* Bump dev
This commit is contained in:
Jaco
2023-06-16 09:45:32 +03:00
committed by GitHub
parent 56fb5c9985
commit 61a8b4041e
17 changed files with 139 additions and 144 deletions
+1 -4
View File
@@ -4,8 +4,6 @@
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { toPromiseMethod } from '@polkadot/api';
@@ -15,8 +13,7 @@ import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json' a
import { Code } from './Code.js';
import { mockApi } from './mock.js';
// FIXME When Jest is removed with ESM tests, this should be converted to use import.meta.url
const v0wasmFlipper = fs.readFileSync(path.join(process.cwd(), 'packages/api-contract/src/test/contracts/ink/v0/flipper.wasm'), 'utf-8');
const v0wasmFlipper = fs.readFileSync(new URL('../test/contracts/ink/v0/flipper.wasm', import.meta.url), 'utf-8');
describe('Code', (): void => {
it('can construct with an individual ABI/WASM combo', (): void => {