Skip to content

Commit 1c63937

Browse files
test: empty dist_dir should work
1 parent f1967b2 commit 1c63937

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "pymakr",
3-
"displayName": "Pymakr",
2+
"name": "pymakr-preview",
3+
"displayName": "Pymakr - Preview",
44
"publisher": "Pycom",
55
"description": "Official Pymakr plugin for Pycom devices.",
66
"version": "2.22.4",
77
"repository": {
88
"url": "https://github.com/pycom/pymakr-vsc"
99
},
10-
"preview": false,
10+
"preview": true,
1111
"engines": {
1212
"vscode": "^1.67.0",
1313
"node": "^16.13.0"

test/suite/integration/projects.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,19 @@ test("can upload project", async () => {
5454
assert.equal(file.toString(), 'print("hello world")');
5555
});
5656
});
57+
58+
test("can change dist_dir to root", () => {
59+
const configFile = readFileSync(`${projectPath1}/pymakr.conf`, "utf8");
60+
const config = JSON.parse(configFile);
61+
config.dist_dir = "";
62+
writeFileSync(`${projectPath1}/pymakr.conf`, JSON.stringify(config, null, 2));
63+
const device = getDevice();
64+
const project = getProject();
65+
test('"upload project" uploads the dist_dir', async () => {
66+
const root = device.config.rootPath;
67+
await pymakr.commands.uploadProject({ device, project });
68+
const files = await device.adapter.listFiles(root, { recursive: true });
69+
const filenames = files.map((file) => file.filename);
70+
assert.deepEqual(filenames, [`${root}`, `${root}/device`, `${root}/device/script.py`, `${root}/pymakr.conf`]);
71+
});
72+
});

0 commit comments

Comments
 (0)