Skip to content

Commit d557db4

Browse files
author
Akos Kitta
committed
fix: skip the <, > test on Windows
it's a reserved character, so the test is invalid Signed-off-by: Akos Kitta <[email protected]>
1 parent dc48d7c commit d557db4

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

Diff for: arduino-ide-extension/src/test/node/sketches-service-impl.slow-test.ts

+29-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
Disposable,
33
DisposableCollection,
44
} from '@theia/core/lib/common/disposable';
5+
import { isWindows } from '@theia/core/lib/common/os';
56
import { FileUri } from '@theia/core/lib/node/file-uri';
67
import { Container } from '@theia/core/shared/inversify';
78
import { expect } from 'chai';
@@ -227,13 +228,35 @@ describe('sketches-service-impl', () => {
227228
expect(mainFileContentTwoAfterCopy).to.be.equal(contentOne);
228229
});
229230

230-
[
231-
['(', ')', 'parentheses'],
232-
['[', ']', 'brackets'],
233-
['{', '}', 'braces'],
234-
['<', '>', 'chevrons'],
235-
].map(([open, close, name]) =>
231+
(
232+
[
233+
['(', ')', 'parentheses'],
234+
['[', ']', 'brackets'],
235+
['{', '}', 'braces'],
236+
[
237+
'<',
238+
'>',
239+
'chevrons',
240+
{
241+
predicate: () => isWindows,
242+
why: '< (less than) and > (greater than) are reserved characters on Windows (https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions)',
243+
},
244+
],
245+
] as [
246+
open: string,
247+
close: string,
248+
name: string,
249+
skip?: { predicate: () => boolean; why: string }
250+
][]
251+
).map(([open, close, name, skip]) =>
236252
it(`should copy a sketch when the path contains ${name} in the sketch folder path: '${open},${close}'`, async function () {
253+
if (skip) {
254+
const { predicate, why } = skip;
255+
if (predicate()) {
256+
console.info(why);
257+
return this.skip();
258+
}
259+
}
237260
this.timeout(testTimeout);
238261
const sketchesService =
239262
container.get<SketchesServiceImpl>(SketchesService);

0 commit comments

Comments
 (0)