Skip to content

Commit b80e90d

Browse files
fix(0.2.2): replace .temp.log test with robust test
2 parents 0fc3ff5 + 436f869 commit b80e90d

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

curriculum/locales/english/learn-the-metaplex-sdk-by-minting-an-nft.md

+29-8
Original file line numberDiff line numberDiff line change
@@ -2190,14 +2190,35 @@ You should run `solana-test-validator --bpf-program metaqbxxUerdq28cj1RbAWkYQm3y
21902190
21912191
```js
21922192
await new Promise(res => setTimeout(() => res(), 2000));
2193-
// TODO: Tests do not watch `.temp.log`
2194-
const temp = await __helpers.getTemp();
2195-
console.log(temp.slice(0, 500));
2196-
assert.include(
2197-
temp,
2198-
'solana-test-validator --bpf-program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s ./mlp_token.so --reset',
2199-
'Run `solana-test-validator --bpf-program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s ./mlp_token.so --reset` in the terminal'
2200-
);
2193+
const command = `curl http://127.0.0.1:8899 -X POST -H "Content-Type: application/json" -d '
2194+
{
2195+
"jsonrpc": "2.0",
2196+
"id": 1,
2197+
"method": "getProgramAccounts",
2198+
"params": [
2199+
"BPFLoader2111111111111111111111111111111111", {
2200+
"encoding": "base64",
2201+
"dataSlice": {
2202+
"length": 0,
2203+
"offset": 0
2204+
}
2205+
}
2206+
]
2207+
}'`;
2208+
const { stdout, stderr } = await __helpers.getCommandOutput(command);
2209+
try {
2210+
const jsonOut = JSON.parse(stdout);
2211+
assert.exists(
2212+
jsonOut.result.find(
2213+
r => r.pubkey === 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'
2214+
)
2215+
);
2216+
} catch (e) {
2217+
assert.fail(
2218+
e,
2219+
'Try running `solana-test-validator --bpf-program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s ./mlp_token.so --reset`'
2220+
);
2221+
}
22012222
```
22022223
22032224
The validator should be running at `http://127.0.0.1:8899`.

freecodecamp.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"path": ".",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"scripts": {
55
"develop-course": "NODE_ENV=development node ./node_modules/@freecodecamp/freecodecamp-os/.freeCodeCamp/tooling/server.js",
66
"run-course": "NODE_ENV=production node ./node_modules/@freecodecamp/freecodecamp-os/.freeCodeCamp/tooling/server.js",

0 commit comments

Comments
 (0)