|
2 | 2 | Disposable,
|
3 | 3 | DisposableCollection,
|
4 | 4 | } from '@theia/core/lib/common/disposable';
|
| 5 | +import { isWindows } from '@theia/core/lib/common/os'; |
5 | 6 | import { FileUri } from '@theia/core/lib/node/file-uri';
|
6 | 7 | import { Container } from '@theia/core/shared/inversify';
|
7 | 8 | import { expect } from 'chai';
|
@@ -227,13 +228,35 @@ describe('sketches-service-impl', () => {
|
227 | 228 | expect(mainFileContentTwoAfterCopy).to.be.equal(contentOne);
|
228 | 229 | });
|
229 | 230 |
|
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]) => |
236 | 252 | 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 | + } |
237 | 260 | this.timeout(testTimeout);
|
238 | 261 | const sketchesService =
|
239 | 262 | container.get<SketchesServiceImpl>(SketchesService);
|
|
0 commit comments