fix: Ensure dir exists before reading in fixture tests (#3819)

### Description

- Makes SDK tests not require solidity tests have run first
pull/3840/head
Yorke Rhodes 6 months ago committed by GitHub
parent 6971d8da02
commit 1f9a3e9be6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      typescript/sdk/src/ism/metadata/aggregation.test.ts
  2. 4
      typescript/sdk/src/ism/metadata/multisig.test.ts

@ -1,5 +1,5 @@
import { expect } from 'chai';
import { readFileSync, readdirSync } from 'fs';
import { existsSync, readFileSync, readdirSync } from 'fs';
import {
AggregationIsmMetadata,
@ -8,7 +8,7 @@ import {
import { Fixture } from './types.test.js';
const path = '../../solidity/fixtures/aggregation';
const files = readdirSync(path);
const files = existsSync(path) ? readdirSync(path) : [];
const fixtures: Fixture<AggregationIsmMetadata>[] = files
.map((f) => JSON.parse(readFileSync(`${path}/${f}`, 'utf8')))
.map((contents) => {

@ -1,5 +1,5 @@
import { expect } from 'chai';
import { readFileSync, readdirSync } from 'fs';
import { existsSync, readFileSync, readdirSync } from 'fs';
import { SignatureLike } from '@hyperlane-xyz/utils';
@ -9,7 +9,7 @@ import { MultisigMetadata, MultisigMetadataBuilder } from './multisig.js';
import { Fixture } from './types.test.js';
const path = '../../solidity/fixtures/multisig';
const files = readdirSync(path);
const files = existsSync(path) ? readdirSync(path) : [];
const fixtures: Fixture<MultisigMetadata>[] = files
.map((f) => JSON.parse(readFileSync(`${path}/${f}`, 'utf8')))
.map((contents) => {

Loading…
Cancel
Save