Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add launchTestNode utility #1356

Open
wants to merge 150 commits into
base: master
Choose a base branch
from
Open

Conversation

nedsalk
Copy link
Contributor

@nedsalk nedsalk commented Oct 17, 2023

This PR introduces the launchTestNode utility. The idea is for it to be the way to setup tests for interacting with sway programs, both internally and for our users. It allows for full test isolation by creating a node for each test and disposing of it at the end of the test. Besides the main benefit of test isolation (which is ideal for defending against flaky tests), this tool would also speed up our test suite.
It makes use of TS 5.2 explicit resource management to automatically kill the node it launches and provides a way to tweak wallet states in the genesis block, deploy contracts, as well as lower level settings like the provider options and node options.

This builds on the great work done in #1204.

Usage example:

using launched = await launchTestNode({
  walletConfig: { count: 2 },
  deployContracts: [ 
  {
    deployer: TestContract__factory,
    bytecode: contractBytecode
  }
 ],
});

const {
  contracts: [contract],
  wallets: [wallet1, wallet2],
} = launched;

This could be nicely tied into #1330 where a sample test file that's testing the contract can be added, demonstrating the preferred way of testing sway programs. We can add e.g. vitest as the default framework in the scaffold just so that the developer can run the tests immediately.

closes #1254

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

Coverage report

❌ An unexpected error occurred. For more details, check console

Error: The process '/home/runner/setup-pnpm/node_modules/.bin/pnpm' failed with exit code 1
St.
Category Percentage Covered / Total
🟢 Statements
86.48% (-0.13% 🔻)
6335/7325
🟡 Branches
71.34% (+0.64% 🔼)
1028/1441
🟡 Functions
77.66% (+0.32% 🔼)
1043/1343
🟢 Lines
86.4% (-0.19% 🔻)
6060/7014
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / test-utils.ts
100% 100% 100% 100%
🟢
... / setup-test-provider.ts
100% 83.33% 100% 100%
🟢
... / index.ts
100% 100% 100% 100%
🟢
... / index.ts
100% 100% 100% 100%
🔴
... / get-transaction-summary.ts
23.08% 0% 0% 23.08%
🟢
... / defaultChainConfig.ts
100% 100% 100% 100%
🟢
... / launchTestNode.ts
97.78% 84.62% 100% 97.73%
🟢
... / launch-custom-provider-and-get-wallets.ts
100% 85.71% 100% 100%
🟢
... / wallet-config.ts
100% 95.83% 100% 100%
🟢
... / test-node-launcher.ts
97.67% 96% 100% 97.62%
🟡
... / contract-factory.ts
60% 41.18% 37.5% 60%
🟡
... / util.ts
79.31% 0% 66.67% 78.26%
🟢
... / test-message.ts
100% 100% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / test-utils.ts
100% 100%
0% (-100% 🔻)
100%

Test suite run failed

Failed tests: 4/1525. Failed suites: 4/265.
  ● Provider › can cacheUtxo [will not cache inputs cache enabled + no coins]

    TypeError [ERR_INVALID_URL]: Invalid URL

      2006 |     },
      2007 |     getChain(variables?: GqlGetChainQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GqlGetChainQuery> {
    > 2008 |       return withWrapper((wrappedRequestHeaders) => client.request<GqlGetChainQuery>(GetChainDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getChain', 'query');
           |                                                            ^
      2009 |     },
      2010 |     getTransaction(variables: GqlGetTransactionQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GqlGetTransactionQuery> {
      2011 |       return withWrapper((wrappedRequestHeaders) => client.request<GqlGetTransactionQuery>(GetTransactionDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getTransaction', 'query');

      at parseURL (node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1164:12)
      at new Request (node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1210:17)
      at node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1449:19
      at fetch (node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1447:9)
      at fetch (node_modules/.pnpm/cross-fetch@4.0.0/node_modules/cross-fetch/dist/node-ponyfill.js:10:20)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:177:16
      at step (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:63:23)
      at Object.next (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:44:53)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:38:71
      at Object.<anonymous>.__awaiter (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:34:12)
      at post (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:160:12)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:466:26
      at step (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:63:23)
      at Object.next (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:44:53)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:38:71
      at Object.<anonymous>.__awaiter (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:34:12)
      at makeRequest (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:360:12)
      at GraphQLClient.request (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:323:12)
      at action (packages/providers/src/__generated__/operations.ts:2008:60)
      at withWrapper (packages/providers/src/__generated__/operations.ts:1997:88)
      at Object.getChain (packages/providers/src/__generated__/operations.ts:2008:14)
      at Provider.fetchChain (packages/providers/src/provider.ts:462:45)
      at Provider.fetchChainAndNodeInfo (packages/providers/src/provider.ts:359:30)
      at Function.create (packages/providers/src/provider.ts:295:20)
      at setupTestProvider (packages/providers/src/utils/test-utils/setup-test-provider.ts:42:37)
      at async Object.<anonymous> (packages/providers/test/provider.test.ts:379:28)


  ● Doc Examples › can connect to testnet

    Unknown type "PredicateParameters": {"response":{"data":null,"errors":[{"message":"Unknown type \"PredicateParameters\"","locations":[{"line":60,"column":1}]},{"message":"Unknown type \"ScriptParameters\"","locations":[{"line":67,"column":1}]},{"message":"Unknown field \"txParams\" on type \"ConsensusParameters\".","locations":[{"line":30,"column":3}]},{"message":"Unknown field \"predicateParams\" on type \"ConsensusParameters\".","locations":[{"line":33,"column":3}]},{"message":"Unknown field \"scriptParams\" on type \"ConsensusParameters\".","locations":[{"line":36,"column":3}]},{"message":"Unknown field \"contractParams\" on type \"ConsensusParameters\". Did you mean \"contractMaxSize\"?","locations":[{"line":39,"column":3}]},{"message":"Unknown field \"feeParams\" on type \"ConsensusParameters\".","locations":[{"line":42,"column":3}]},{"message":"Unknown field \"gasCosts\" on type \"ConsensusParameters\".","locations":[{"line":45,"column":3}]},{"message":"Unknown field \"baseAssetId\" on type \"ConsensusParameters\".","locations":[{"line":48,"column":3}]},{"message":"Unknown type \"ContractParameters\"","locations":[{"line":72,"column":1}]},{"message":"Unknown type \"LightOperation\"","locations":[{"line":237,"column":3}]},{"message":"Unknown type \"HeavyOperation\"","locations":[{"line":241,"column":3}]},{"message":"Unknown type \"FeeParameters\"","locations":[{"line":77,"column":1}]},{"message":"Unknown type \"TxParameters\"","locations":[{"line":52,"column":1}]},{"message":"Unknown field \"poph\" on type \"GasCosts\".","locations":[{"line":137,"column":3}]},{"message":"Unknown field \"popl\" on type \"GasCosts\".","locations":[{"line":138,"column":3}]},{"message":"Unknown field \"pshh\" on type \"GasCosts\".","locations":[{"line":139,"column":3}]},{"message":"Unknown field \"pshl\" on type \"GasCosts\".","locations":[{"line":140,"column":3}]},{"message":"Field \"k256\" must not have a selection since type \"U64\" has no subfields","locations":[{"line":181,"column":3}]},{"message":"Fragment \"DependentCostFragment\" cannot be spread here as objects of type \"U64\" can never be of type \"DependentCost\"","locations":[{"line":182,"column":5}]},{"message":"Field \"mcpi\" must not have a selection since type \"U64\" has no subfields","locations":[{"line":199,"column":3}]},{"message":"Fragment \"DependentCostFragment\" cannot be spread here as objects of type \"U64\" can never be of type \"DependentCost\"","locations":[{"line":200,"column":5}]},{"message":"Field \"s256\" must not have a selection since type \"U64\" has no subfields","locations":[{"line":208,"column":3}]},{"message":"Fragment \"DependentCostFragment\" cannot be spread here as objects of type \"U64\" can never be of type \"DependentCost\"","locations":[{"line":209,"column":5}]},{"message":"Field \"scwq\" must not have a selection since type \"U64\" has no subfields","locations":[{"line":211,"column":3}]},{"message":"Fragment \"DependentCostFragment\" cannot be spread here as objects of type \"U64\" can never be of type \"DependentCost\"","locations":[{"line":212,"column":5}]},{"message":"Field \"swwq\" must not have a selection since type \"U64\" has no subfields","locations":[{"line":220,"column":3}]},{"message":"Fragment \"DependentCostFragment\" cannot be spread here as objects of type \"U64\" can never be of type \"DependentCost\"","locations":[{"line":221,"column":5}]},{"message":"Unknown field \"contractRoot\" on type \"GasCosts\".","locations":[{"line":223,"column":3}]},{"message":"Unknown field \"stateRoot\" on type \"GasCosts\".","locations":[{"line":226,"column":3}]},{"message":"Unknown field \"vmInitialization\" on type \"GasCosts\".","locations":[{"line":229,"column":3}]},{"message":"Unknown field \"newStoragePerByte\" on type \"GasCosts\".","locations":[{"line":232,"column":3}]},{"message":"Unknown field \"daHeight\" on type \"ChainInfo\".","locations":[{"line":12,"column":3}]}],"status":200,"headers":{}},"request":{"query":"query getChain {\n  chain {\n    ...chainInfoFragment\n  }\n}\n\nfragment chainInfoFragment on ChainInfo {\n  name\n  latestBlock {\n    ...blockFragment\n  }\n  daHeight\n  consensusParameters {\n    ...consensusParametersFragment\n  }\n}\n\nfragment blockFragment on Block {\n  id\n  header {\n    height\n    time\n  }\n  transactions {\n    id\n  }\n}\n\nfragment consensusParametersFragment on ConsensusParameters {\n  txParams {\n    ...TxParametersFragment\n  }\n  predicateParams {\n    ...PredicateParametersFragment\n  }\n  scriptParams {\n    ...ScriptParametersFragment\n  }\n  contractParams {\n    ...ContractParametersFragment\n  }\n  feeParams {\n    ...FeeParametersFragment\n  }\n  gasCosts {\n    ...GasCostsFragment\n  }\n  baseAssetId\n  chainId\n}\n\nfragment TxParametersFragment on TxParameters {\n  maxInputs\n  maxOutputs\n  maxWitnesses\n  maxGasPerTx\n  maxSize\n}\n\nfragment PredicateParametersFragment on PredicateParameters {\n  maxPredicateLength\n  maxPredicateDataLength\n  maxGasPerPredicate\n  maxMessageDataLength\n}\n\nfragment ScriptParametersFragment on ScriptParameters {\n  maxScriptLength\n  maxScriptDataLength\n}\n\nfragment ContractParametersFragment on ContractParameters {\n  contractMaxSize\n  maxStorageSlots\n}\n\nfragment FeeParametersFragment on FeeParameters {\n  gasPriceFactor\n  gasPerByte\n}\n\nfragment GasCostsFragment on GasCosts {\n  add\n  addi\n  aloc\n  and\n  andi\n  bal\n  bhei\n  bhsh\n  burn\n  cb\n  cfei\n  cfsi\n  croo\n  div\n  divi\n  ecr1\n  eck1\n  ed19\n  eq\n  exp\n  expi\n  flag\n  gm\n  gt\n  gtf\n  ji\n  jmp\n  jne\n  jnei\n  jnzi\n  jmpf\n  jmpb\n  jnzf\n  jnzb\n  jnef\n  jneb\n  lb\n  log\n  lt\n  lw\n  mint\n  mlog\n  modOp\n  modi\n  moveOp\n  movi\n  mroo\n  mul\n  muli\n  mldv\n  noop\n  not\n  or\n  ori\n  poph\n  popl\n  pshh\n  pshl\n  ret\n  rvrt\n  sb\n  sll\n  slli\n  srl\n  srli\n  srw\n  sub\n  subi\n  sw\n  sww\n  time\n  tr\n  tro\n  wdcm\n  wqcm\n  wdop\n  wqop\n  wdml\n  wqml\n  wddv\n  wqdv\n  wdmd\n  wqmd\n  wdam\n  wqam\n  wdmm\n  wqmm\n  xor\n  xori\n  call {\n    ...DependentCostFragment\n  }\n  ccp {\n    ...DependentCostFragment\n  }\n  csiz {\n    ...DependentCostFragment\n  }\n  k256 {\n    ...DependentCostFragment\n  }\n  ldc {\n    ...DependentCostFragment\n  }\n  logd {\n    ...DependentCostFragment\n  }\n  mcl {\n    ...DependentCostFragment\n  }\n  mcli {\n    ...DependentCostFragment\n  }\n  mcp {\n    ...DependentCostFragment\n  }\n  mcpi {\n    ...DependentCostFragment\n  }\n  meq {\n    ...DependentCostFragment\n  }\n  retd {\n    ...DependentCostFragment\n  }\n  s256 {\n    ...DependentCostFragment\n  }\n  scwq {\n    ...DependentCostFragment\n  }\n  smo {\n    ...DependentCostFragment\n  }\n  srwq {\n    ...DependentCostFragment\n  }\n  swwq {\n    ...DependentCostFragment\n  }\n  contractRoot {\n    ...DependentCostFragment\n  }\n  stateRoot {\n    ...DependentCostFragment\n  }\n  vmInitialization {\n    ...DependentCostFragment\n  }\n  newStoragePerByte\n}\n\nfragment DependentCostFragment on DependentCost {\n  __typename\n  ... on LightOperation {\n    base\n    unitsPerGas\n  }\n  ... on HeavyOperation {\n    base\n    gasPerUnit\n  }\n}"}}

      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:497:11
      at step (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:63:23)
      at Object.next (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:44:53)
      at fulfilled (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:35:58)


  ● TestNodeLauncher › multiple contracts can be deployed with different wallets

    TypeError [ERR_INVALID_URL]: Invalid URL

      2006 |     },
      2007 |     getChain(variables?: GqlGetChainQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GqlGetChainQuery> {
    > 2008 |       return withWrapper((wrappedRequestHeaders) => client.request<GqlGetChainQuery>(GetChainDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getChain', 'query');
           |                                                            ^
      2009 |     },
      2010 |     getTransaction(variables: GqlGetTransactionQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GqlGetTransactionQuery> {
      2011 |       return withWrapper((wrappedRequestHeaders) => client.request<GqlGetTransactionQuery>(GetTransactionDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getTransaction', 'query');

      at parseURL (node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1164:12)
      at new Request (node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1210:17)
      at node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1449:19
      at fetch (node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1447:9)
      at fetch (node_modules/.pnpm/cross-fetch@4.0.0/node_modules/cross-fetch/dist/node-ponyfill.js:10:20)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:177:16
      at step (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:63:23)
      at Object.next (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:44:53)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:38:71
      at Object.<anonymous>.__awaiter (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:34:12)
      at post (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:160:12)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:466:26
      at step (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:63:23)
      at Object.next (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:44:53)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:38:71
      at Object.<anonymous>.__awaiter (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:34:12)
      at makeRequest (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:360:12)
      at GraphQLClient.Object.<anonymous>.GraphQLClient.request (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:323:12)
      at packages/providers/src/__generated__/operations.ts:2008:60
      at defaultWrapper (packages/providers/src/__generated__/operations.ts:1997:88)
      at Object.getChain (packages/providers/src/__generated__/operations.ts:2008:14)
      at _Provider.fetchChain (packages/providers/src/provider.ts:462:45)
      at _Provider.fetchChainAndNodeInfo (packages/providers/src/provider.ts:359:30)
      at Function.create (packages/providers/src/provider.ts:295:20)
      at setupTestProvider (packages/providers/src/utils/test-utils/setup-test-provider.ts:42:37)
      at async launchCustomProviderAndGetWallets (packages/wallet/src/test-utils/launch-custom-provider-and-get-wallets.ts:32:33)
      at async Function.launch (packages/contract/src/test-utils/test-node-launcher.ts:59:44)
      at async Object.<anonymous> (packages/contract/src/test-utils/test-node-launcher.test.ts:134:28)


  ● Bytes Tests › should test bytes input [nested]

    TypeError [ERR_INVALID_URL]: Invalid URL

      2006 |     },
      2007 |     getChain(variables?: GqlGetChainQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GqlGetChainQuery> {
    > 2008 |       return withWrapper((wrappedRequestHeaders) => client.request<GqlGetChainQuery>(GetChainDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getChain', 'query');
           |                                                            ^
      2009 |     },
      2010 |     getTransaction(variables: GqlGetTransactionQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GqlGetTransactionQuery> {
      2011 |       return withWrapper((wrappedRequestHeaders) => client.request<GqlGetTransactionQuery>(GetTransactionDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getTransaction', 'query');

      at parseURL (node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1164:12)
      at new Request (node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1210:17)
      at node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1449:19
      at fetch (node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1447:9)
      at fetch (node_modules/.pnpm/cross-fetch@4.0.0/node_modules/cross-fetch/dist/node-ponyfill.js:10:20)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:177:16
      at step (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:63:23)
      at Object.next (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:44:53)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:38:71
      at Object.<anonymous>.__awaiter (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:34:12)
      at post (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:160:12)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:466:26
      at step (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:63:23)
      at Object.next (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:44:53)
      at node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:38:71
      at Object.<anonymous>.__awaiter (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:34:12)
      at makeRequest (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js:360:12)
      at GraphQLClient.Object.<anonymous>.GraphQLClient.request (node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/src/index.ts:323:12)
      at packages/providers/src/__generated__/operations.ts:2008:60
      at defaultWrapper (packages/providers/src/__generated__/operations.ts:1997:88)
      at Object.getChain (packages/providers/src/__generated__/operations.ts:2008:14)
      at _Provider.fetchChain (packages/providers/src/provider.ts:462:45)
      at _Provider.fetchChainAndNodeInfo (packages/providers/src/provider.ts:359:30)
      at Function.create (packages/providers/src/provider.ts:295:20)
      at setupTestProvider (packages/providers/src/utils/test-utils/setup-test-provider.ts:42:37)
      at async launchCustomProviderAndGetWallets (packages/wallet/src/test-utils/launch-custom-provider-and-get-wallets.ts:32:33)
      at async Function.launch (packages/contract/src/test-utils/test-node-launcher.ts:59:44)
      at async Object.<anonymous> (packages/fuel-gauge/src/bytes.test.ts:78:28)

Report generated by 🧪jest coverage report action from 1f47f6c

@nedsalk nedsalk marked this pull request as ready for review October 23, 2023 18:21
camsjams

This comment was marked as outdated.

@nedsalk nedsalk marked this pull request as draft October 24, 2023 06:11
@nedsalk nedsalk changed the base branch from master to ns/chore/update-formatting-packages October 24, 2023 07:16
@nedsalk

This comment was marked as outdated.

Dhaiwat10

This comment was marked as outdated.

Base automatically changed from ns/chore/update-formatting-packages to master October 30, 2023 21:08
@nedsalk nedsalk marked this pull request as draft October 31, 2023 14:52
@nedsalk

This comment was marked as outdated.

@arboleya

This comment was marked as outdated.

@nedsalk

This comment was marked as outdated.

@nedsalk

This comment was marked as outdated.

@nedsalk nedsalk marked this pull request as ready for review November 14, 2023 15:18
Dhaiwat10
Dhaiwat10 previously approved these changes May 23, 2024
Copy link
Contributor

@petertonysmith94 petertonysmith94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits - but otherwise solid 🤺

petertonysmith94 and others added 2 commits May 24, 2024 08:40
Co-authored-by: Peter Smith <peter@blueoceancomputing.co.uk>
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
80.62%(+0.83%) 72.1%(+1.33%) 77.91%(+0.92%) 80.73%(+0.84%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/provider.ts 67.12%
(+0%)
56.44%
(+0.62%)
76.19%
(+0%)
67.37%
(+0%)
✨ packages/account/src/test-utils/asset-id.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
🔴 packages/account/src/test-utils/launchNode.ts 100%
(+0%)
85.96%
(+0.78%)
77.77%
(+9.35%)
94.87%
(+0.64%)
✨ packages/account/src/test-utils/setup-test-provider-and-wallets.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/account/src/test-utils/test-message.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
🔴 ✨ packages/account/src/test-utils/wallet-config.ts 100%
(+100%)
95.83%
(+95.83%)
100%
(+100%)
100%
(+100%)
🔴 packages/contract/src/contract-factory.ts 52.08%
(+52.08%)
50%
(+50%)
37.5%
(+37.5%)
52.08%
(+52.08%)
🔴 packages/contract/src/util.ts 93.33%
(+93.33%)
0%
(+0%)
66.66%
(+66.66%)
88.23%
(+88.23%)
🔴 ✨ packages/contract/src/test-utils/launch-test-node.ts 97.14%
(+97.14%)
96.42%
(+96.42%)
100%
(+100%)
97.14%
(+97.14%)
✨ packages/utils/src/test-utils/wait-until-unreachable.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)
✨ packages/utils/src/utils/sleep.ts 100%
(+100%)
100%
(+100%)
100%
(+100%)
100%
(+100%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add setupTestProvider test utility
8 participants