LimeChain / matchstick

🔥 Unit testing framework for Subgraph development on The Graph protocol. ⚙️
MIT License
207 stars 17 forks source link

Graph test required datasource #390

Closed FabienCoutant closed 1 year ago

FabienCoutant commented 1 year ago

Hey, I'm trying to run all my tests but a datasource is require everytimes.

I'm on macos (M1 version: Ventura 13.2) with a NixOs env setup.

Here my package.json file:

"scripts": {
    "coverage": "graph test -- -c",
    "test": "graph test"
  },
  "dependencies": {
    "@graphprotocol/graph-cli": "^0.42.3",
    "@graphprotocol/graph-ts": "^0.29.3",
    "@typescript-eslint/eslint-plugin": "^5.57.1",
    "@typescript-eslint/parser": "^5.57.1",
    "env-cmd": "^10.1.0",
    "eslint": "^8.38.0",
    "eslint-config-prettier": "^8.8.0",
    "lint-staged": "^13.2.1",
    "mustache": "^4.2.0",
    "prettier": "^2.8.7",
    "typescript": "^5.0.4"
  },
  "devDependencies": {
    "cross-env": "^7.0.3",
    "matchstick-as": "^0.5.2"
  }

Running yarn test give me the following error:

╰─➤ yarn test                                                                                                                                                                       415ms  11:38:02 2023-04-13 (Jeu)
yarn run v1.22.19
$ graph test
 ›   Error: Missing 1 required arg:
 ›   datasource
 ›   See more help with --help
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

and here my test folder overview:

Capture d’écran 2023-04-13 à 11 43 05

And btw if I specify a datasource a new error appear and asking me to specify a version

dimitrovmaksim commented 1 year ago

Update graph-cli to 0.44.0 or later. There was an issue with the test command.

FabienCoutant commented 1 year ago

It works like a charm now! thx!!