Skip to content

Commit 778ecdb

Browse files
authoredApr 7, 2022
Fix CI error on Windows (#50)
1 parent 589c637 commit 778ecdb

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed
 

‎test/async.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,16 @@ test('do not overwrite when disabled', async t => {
8080
t.is(error.code, 'EEXIST', error.message);
8181
});
8282

83-
test('create directories with specified mode', async t => {
84-
const directory = t.context.destination;
85-
const destination = `${directory}/${uuidv4()}`;
86-
const directoryMode = 0o700;
87-
await cpFile('license', destination, {directoryMode});
88-
const stat = fs.statSync(directory);
89-
t.is(stat.mode & directoryMode, directoryMode);
90-
});
83+
if (process.platform !== 'win32') {
84+
test('create directories with specified mode', async t => {
85+
const directory = t.context.destination;
86+
const destination = `${directory}/${uuidv4()}`;
87+
const directoryMode = 0o700;
88+
await cpFile('license', destination, {directoryMode});
89+
const stat = fs.statSync(directory);
90+
t.is(stat.mode & directoryMode, directoryMode);
91+
});
92+
}
9193

9294
test('do not create `destination` on unreadable `source`', async t => {
9395
const error = await t.throwsAsync(cpFile('node_modules', t.context.destination));

‎test/sync.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ test('do not overwrite when disabled', t => {
8181
t.is(fs.readFileSync(t.context.destination, 'utf8'), '');
8282
});
8383

84-
test('create directories with specified mode', t => {
85-
const directory = t.context.destination;
86-
const destination = `${directory}/${uuidv4()}`;
87-
const directoryMode = 0o700;
88-
cpFile.sync('license', destination, {directoryMode});
89-
const stat = fs.statSync(directory);
90-
t.is(stat.mode & directoryMode, directoryMode);
91-
});
84+
if (process.platform !== 'win32') {
85+
test('create directories with specified mode', t => {
86+
const directory = t.context.destination;
87+
const destination = `${directory}/${uuidv4()}`;
88+
const directoryMode = 0o700;
89+
cpFile.sync('license', destination, {directoryMode});
90+
const stat = fs.statSync(directory);
91+
t.is(stat.mode & directoryMode, directoryMode);
92+
});
93+
}
9294

9395
test('do not create `destination` on unreadable `source`', t => {
9496
t.throws(

0 commit comments

Comments
 (0)
Please sign in to comment.