Remove __dirname usages in tests (#5492)

This commit is contained in:
Jaco
2023-02-17 08:20:29 +02:00
committed by GitHub
parent cc1d51a6ca
commit ea45c7e689
2 changed files with 21 additions and 17 deletions
+3 -1
View File
@@ -3,6 +3,7 @@
import fs from 'fs';
import path from 'path';
import process from 'process';
import { toPromiseMethod } from '@polkadot/api';
@@ -12,7 +13,8 @@ import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json' a
import { Code } from './Code';
import { mockApi } from './mock';
const v0wasmFlipper = fs.readFileSync(path.join(__dirname, '../test/contracts/ink/v0/flipper.wasm'));
// 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');
describe('Code', (): void => {
it('can construct with an individual ABI/WASM combo', (): void => {