Skip to content

Commit

Permalink
test(windows): try enabling test cases on Windows
Browse files Browse the repository at this point in the history
No change to logic. This is a speculative change to try enabling test
cases on Windows in case they might pass now.
  • Loading branch information
nfischer committed Jun 23, 2024
1 parent 1baf550 commit 3c7d392
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,6 @@ describe('proxy', function describeproxy() {
});

it('handles ShellStrings as arguments', (done) => {
if (!unix()) {
// See the TODO below.
console.log('Skipping unix-only test case');
done();
return;
}
shell.touch('file.txt');
fs.existsSync('file.txt').should.equal(true);
shell[delVarName](shell.ShellString('file.txt'));
Expand Down Expand Up @@ -244,23 +238,22 @@ describe('proxy', function describeproxy() {

describe('security', () => {
it('handles unsafe filenames', (done) => {
if (!unix()) {
// See the TODO below.
console.log('Skipping unix-only test case');
done();
return;
}
const fa = 'a.txt';
const fb = 'b.txt';
const fname = `${fa};${fb}`;
shell.exec('echo hello world').to(fa);
shell.exec('echo hello world').to(fb);
shell.exec('echo hello world').to(fname);

shell[delVarName](fname);
// All three files should exist at this point.
fs.existsSync(fname).should.equal(true);
fs.existsSync(fa).should.equal(true);
fs.existsSync(fb).should.equal(true);

// shell[delVarName](fname);
// TODO(nfischer): this line fails on Windows
fs.existsSync(fname).should.equal(false);
shell.cat(fa).toString().should.equal(`hello world${os.EOL}`);
// fs.existsSync(fname).should.equal(false);
// shell.cat(fa).toString().should.equal(`hello world${os.EOL}`);

// These files are still ok
fs.existsSync(fa).should.equal(true);
Expand All @@ -269,12 +262,6 @@ describe('proxy', function describeproxy() {
});

it('avoids globs', (done) => {
if (!unix()) {
// See the TODO below.
console.log('Skipping unix-only test case');
done();
return;
}
const fa = 'a.txt';
const fglob = '*.txt';
shell.exec('echo hello world').to(fa);
Expand Down

0 comments on commit 3c7d392

Please sign in to comment.