mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
28 lines
687 B
JavaScript
28 lines
687 B
JavaScript
const { writeFileShim } = require("../cjs/interpreter/_utils.js");
|
|
|
|
const assert = require("./assert.js");
|
|
|
|
const FS = {
|
|
mkdir(...args) {
|
|
this.mkdir_args = args;
|
|
},
|
|
cwd: () => __dirname,
|
|
writeFile(...args) {
|
|
this.writeFile_args = args;
|
|
},
|
|
};
|
|
|
|
writeFileShim(FS, "./test/abc.js", []);
|
|
assert(JSON.stringify(FS.mkdir_args), `["${__dirname}/test"]`);
|
|
assert(
|
|
JSON.stringify(FS.writeFile_args),
|
|
`["${__dirname}/test/abc.js",{},{"canOwn":true}]`,
|
|
);
|
|
|
|
writeFileShim(FS, "/./../abc.js", []);
|
|
assert(JSON.stringify(FS.mkdir_args), `["${__dirname}"]`);
|
|
assert(
|
|
JSON.stringify(FS.writeFile_args),
|
|
`["${__dirname}/abc.js",{},{"canOwn":true}]`,
|
|
);
|