Skip to content

Commit e292f9e

Browse files
test: create subtests to solve ambiguous timeouts
1 parent 1fd446d commit e292f9e

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

test/suite/integration/devmode.adv.test.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,23 @@ test("can fake deepsleep in devmode", async () => {
6262
});
6363

6464
test("machine.sleep gets transformed to fake_machine.sleep", async () => {
65-
writeFileSync(
66-
projectPath1 + "/main.py",
67-
["import machine", "# machine.sleep(100)", "# machine.deepSleep(100)", 'print("booted")'].join("\n")
68-
);
69-
await readUntil("booted");
70-
const result = await device.adapter.getFile("main.py");
71-
assert.equal(
72-
result.toString(),
73-
["import fake_machine", "# fake_machine.sleep(100)", "# fake_machine.sleep(100)", 'print("booted")'].join("\n")
74-
);
65+
test("can write main.py", async () => {
66+
writeFileSync(
67+
projectPath1 + "/main.py",
68+
["import machine", "# machine.sleep(100)", "# machine.deepSleep(100)", 'print("booted")'].join("\n")
69+
);
70+
await readUntil("booted");
71+
});
72+
test("can read main.py", async () => {
73+
const result = await device.adapter.getFile("main.py");
74+
assert.equal(
75+
result.toString(),
76+
["import fake_machine", "# fake_machine.sleep(100)", "# fake_machine.sleep(100)", 'print("booted")'].join(
77+
"\n"
78+
)
79+
);
80+
});
81+
});
7582

7683
test("can stop devMode", async () => {
7784
await pymakr.commands.stopDevMode({ project });

0 commit comments

Comments
 (0)