Skip to content

Commit 19b208b

Browse files
committed
tests: Add graph init --from-contract test for NEAR
1 parent 8b436d6 commit 19b208b

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

tests/cli/init.test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,32 @@ describe('Init', () => {
125125
},
126126
)
127127
})
128+
129+
describe('NEAR', () => {
130+
const nearBaseDir = path.join(baseDir, 'near')
131+
132+
cliTest(
133+
'From contract',
134+
[
135+
'init',
136+
'--protocol',
137+
'near',
138+
'--product',
139+
'hosted-service',
140+
'--from-contract',
141+
'app.good-morning.near',
142+
'--network',
143+
'near-mainnet',
144+
'user/near-from-contract',
145+
path.join(nearBaseDir, 'from-contract'),
146+
],
147+
path.join('init', 'near', 'from-contract'),
148+
{
149+
exitCode: 0,
150+
timeout: 100000,
151+
cwd: nearBaseDir,
152+
deleteDir: true,
153+
},
154+
)
155+
})
128156
})
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- Create subgraph scaffold
2+
Generate subgraph
3+
- Create subgraph scaffold
4+
Write subgraph to directory
5+
- Create subgraph scaffold
6+
✔ Create subgraph scaffold
7+
- Initialize subgraph repository
8+
✔ Initialize subgraph repository
9+
- Install dependencies with yarn
10+
✔ Install dependencies with yarn
11+
- Generate ABI and schema types with yarn codegen
12+
✔ Generate ABI and schema types with yarn codegen
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
Subgraph user/near-from-contract created in from-contract
3+
4+
Next steps:
5+
6+
1. Run `graph auth` to authenticate with your deploy key.
7+
8+
2. Type `cd from-contract` to enter the subgraph.
9+
10+
3. Run `yarn deploy` to deploy the subgraph.
11+
12+
Make sure to visit the documentation on https://thegraph.com/docs/ for further information.

0 commit comments

Comments
 (0)