Skip to content

Commit 5764cae

Browse files
chore: run CI on windows (#119)
* chore: run CI on windows * test: sort snapshots * test: update failing tests * test: update failing e2e tests
1 parent 05dfb6e commit 5764cae

File tree

19 files changed

+348
-265
lines changed

19 files changed

+348
-265
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
12-
11+
runs-on: ${{ matrix.os }}
1312
strategy:
1413
matrix:
1514
node_version: [16]
15+
os: [ubuntu-latest, windows-latest]
1616

1717
steps:
1818
- name: Cancel Previous Runs

e2e/qwik-nx-e2e/tests/storybook.spec.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
killPort,
1212
killPorts,
1313
} from '@qwikifiers/e2e/utils';
14+
import { normalize } from 'path';
1415

1516
const STORYBOOK_PORT = 4400;
1617

@@ -94,13 +95,18 @@ function checkStorybookIsBuiltAndServed(
9495
}
9596
);
9697

98+
const mdxPattern = normalize(`${type}/${projectName}/**/*.stories.mdx`);
99+
const storiesPattern = normalize(
100+
`${type}/${projectName}/**/*.stories.@(js|jsx|ts|tsx)`
101+
);
102+
97103
// it is expected that projects won't have stories by default and storybook should recognize it.
98104
expect(resultOutput).toContain(
99-
`No story files found for the specified pattern: ${type}/${projectName}/**/*.stories.mdx`
105+
`No story files found for the specified pattern: ${mdxPattern}`
100106
);
101107
if (!hasTsStories) {
102108
expect(resultOutput).toContain(
103-
`No story files found for the specified pattern: ${type}/${projectName}/**/*.stories.@(js|jsx|ts|tsx)`
109+
`No story files found for the specified pattern: ${storiesPattern}`
104110
);
105111
}
106112
try {

packages/qwik-nx/src/generators/application/__snapshots__/generator.spec.ts.snap

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -105,37 +105,17 @@ exports[`qwik-nx generator should run successfully 2`] = `
105105
exports[`qwik-nx generator should run successfully 3`] = `
106106
Array [
107107
Object {
108-
"path": ".prettierrc",
109-
"type": "CREATE",
110-
},
111-
Object {
112-
"path": "package.json",
113-
"type": "CREATE",
114-
},
115-
Object {
116-
"path": "nx.json",
108+
"path": ".prettierignore",
117109
"type": "CREATE",
118110
},
119111
Object {
120-
"path": "tsconfig.base.json",
112+
"path": ".prettierrc",
121113
"type": "CREATE",
122114
},
123115
Object {
124116
"path": "apps/.gitignore",
125117
"type": "CREATE",
126118
},
127-
Object {
128-
"path": "libs/.gitignore",
129-
"type": "CREATE",
130-
},
131-
Object {
132-
"path": ".prettierignore",
133-
"type": "CREATE",
134-
},
135-
Object {
136-
"path": "apps/myapp/project.json",
137-
"type": "CREATE",
138-
},
139119
Object {
140120
"path": "apps/myapp/.eslintrc.json",
141121
"type": "CREATE",
@@ -145,11 +125,11 @@ Array [
145125
"type": "CREATE",
146126
},
147127
Object {
148-
"path": "apps/myapp/README.md",
128+
"path": "apps/myapp/package.json",
149129
"type": "CREATE",
150130
},
151131
Object {
152-
"path": "apps/myapp/package.json",
132+
"path": "apps/myapp/project.json",
153133
"type": "CREATE",
154134
},
155135
Object {
@@ -164,6 +144,10 @@ Array [
164144
"path": "apps/myapp/public/robots.txt",
165145
"type": "CREATE",
166146
},
147+
Object {
148+
"path": "apps/myapp/README.md",
149+
"type": "CREATE",
150+
},
167151
Object {
168152
"path": "apps/myapp/src/components/header/header.css",
169153
"type": "CREATE",
@@ -236,5 +220,21 @@ Array [
236220
"path": "apps/myapp/vite.config.ts",
237221
"type": "CREATE",
238222
},
223+
Object {
224+
"path": "libs/.gitignore",
225+
"type": "CREATE",
226+
},
227+
Object {
228+
"path": "nx.json",
229+
"type": "CREATE",
230+
},
231+
Object {
232+
"path": "package.json",
233+
"type": "CREATE",
234+
},
235+
Object {
236+
"path": "tsconfig.base.json",
237+
"type": "CREATE",
238+
},
239239
]
240240
`;

packages/qwik-nx/src/generators/application/generator.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ describe('qwik-nx generator', () => {
3939
).toMatchSnapshot();
4040
expect(appTree.read('apps/myapp/project.json', 'utf-8')).toMatchSnapshot();
4141
expect(
42-
appTree.listChanges().map((c) => ({ path: c.path, type: c.type }))
42+
[...appTree.listChanges()]
43+
.sort((a, b) => a.path.localeCompare(b.path))
44+
.map((c) => ({ path: c.path, type: c.type }))
4345
).toMatchSnapshot();
4446
});
4547

packages/qwik-nx/src/generators/e2e-project/generator.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('e2e project', () => {
1313
let appTree: Tree;
1414
const defaultOptions: Omit<E2eProjectGeneratorSchema, 'e2eTestRunner'> = {
1515
project: 'myapp',
16+
skipFormat: true,
1617
};
1718

1819
jest.spyOn(devkit, 'ensurePackage').mockReturnValue(Promise.resolve());

packages/qwik-nx/src/generators/host/__snapshots__/generator.spec.ts.snap

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -169,37 +169,17 @@ exports[`host generator should run successfully 3`] = `
169169
exports[`host generator should run successfully 4`] = `
170170
Array [
171171
Object {
172-
"path": ".prettierrc",
173-
"type": "CREATE",
174-
},
175-
Object {
176-
"path": "package.json",
177-
"type": "CREATE",
178-
},
179-
Object {
180-
"path": "nx.json",
172+
"path": ".prettierignore",
181173
"type": "CREATE",
182174
},
183175
Object {
184-
"path": "tsconfig.base.json",
176+
"path": ".prettierrc",
185177
"type": "CREATE",
186178
},
187179
Object {
188180
"path": "apps/.gitignore",
189181
"type": "CREATE",
190182
},
191-
Object {
192-
"path": "libs/.gitignore",
193-
"type": "CREATE",
194-
},
195-
Object {
196-
"path": ".prettierignore",
197-
"type": "CREATE",
198-
},
199-
Object {
200-
"path": "apps/myhostapp/project.json",
201-
"type": "CREATE",
202-
},
203183
Object {
204184
"path": "apps/myhostapp/.eslintrc.json",
205185
"type": "CREATE",
@@ -209,11 +189,11 @@ Array [
209189
"type": "CREATE",
210190
},
211191
Object {
212-
"path": "apps/myhostapp/README.md",
192+
"path": "apps/myhostapp/package.json",
213193
"type": "CREATE",
214194
},
215195
Object {
216-
"path": "apps/myhostapp/package.json",
196+
"path": "apps/myhostapp/project.json",
217197
"type": "CREATE",
218198
},
219199
Object {
@@ -228,6 +208,10 @@ Array [
228208
"path": "apps/myhostapp/public/robots.txt",
229209
"type": "CREATE",
230210
},
211+
Object {
212+
"path": "apps/myhostapp/README.md",
213+
"type": "CREATE",
214+
},
231215
Object {
232216
"path": "apps/myhostapp/src/components/header/header.,",
233217
"type": "CREATE",
@@ -240,10 +224,18 @@ Array [
240224
"path": "apps/myhostapp/src/components/icons/qwik.tsx",
241225
"type": "CREATE",
242226
},
227+
Object {
228+
"path": "apps/myhostapp/src/components/remote-mfe/remote-mfe.tsx",
229+
"type": "CREATE",
230+
},
243231
Object {
244232
"path": "apps/myhostapp/src/components/router-head/router-head.tsx",
245233
"type": "CREATE",
246234
},
235+
Object {
236+
"path": "apps/myhostapp/src/config/remotes.json",
237+
"type": "CREATE",
238+
},
247239
Object {
248240
"path": "apps/myhostapp/src/entry.dev.tsx",
249241
"type": "CREATE",
@@ -264,6 +256,10 @@ Array [
264256
"path": "apps/myhostapp/src/root.tsx",
265257
"type": "CREATE",
266258
},
259+
Object {
260+
"path": "apps/myhostapp/src/routes/about/index.tsx",
261+
"type": "CREATE",
262+
},
267263
Object {
268264
"path": "apps/myhostapp/src/routes/flower/flower.,",
269265
"type": "CREATE",
@@ -296,10 +292,6 @@ Array [
296292
"path": "apps/myhostapp/vite.config.ts",
297293
"type": "CREATE",
298294
},
299-
Object {
300-
"path": "apps/remote1/project.json",
301-
"type": "CREATE",
302-
},
303295
Object {
304296
"path": "apps/remote1/.eslintrc.json",
305297
"type": "CREATE",
@@ -309,11 +301,11 @@ Array [
309301
"type": "CREATE",
310302
},
311303
Object {
312-
"path": "apps/remote1/README.md",
304+
"path": "apps/remote1/package.json",
313305
"type": "CREATE",
314306
},
315307
Object {
316-
"path": "apps/remote1/package.json",
308+
"path": "apps/remote1/project.json",
317309
"type": "CREATE",
318310
},
319311
Object {
@@ -328,6 +320,14 @@ Array [
328320
"path": "apps/remote1/public/robots.txt",
329321
"type": "CREATE",
330322
},
323+
Object {
324+
"path": "apps/remote1/README.md",
325+
"type": "CREATE",
326+
},
327+
Object {
328+
"path": "apps/remote1/src/components/.gitkeep",
329+
"type": "CREATE",
330+
},
331331
Object {
332332
"path": "apps/remote1/src/components/header/header.,",
333333
"type": "CREATE",
@@ -352,6 +352,10 @@ Array [
352352
"path": "apps/remote1/src/root.tsx",
353353
"type": "CREATE",
354354
},
355+
Object {
356+
"path": "apps/remote1/src/routes/about/index.tsx",
357+
"type": "CREATE",
358+
},
355359
Object {
356360
"path": "apps/remote1/src/routes/index.tsx",
357361
"type": "CREATE",
@@ -381,43 +385,39 @@ Array [
381385
"type": "CREATE",
382386
},
383387
Object {
384-
"path": "apps/remote1/src/components/.gitkeep",
385-
"type": "CREATE",
386-
},
387-
Object {
388-
"path": "apps/remote1/src/routes/about/index.tsx",
388+
"path": "apps/remote2/.eslintrc.json",
389389
"type": "CREATE",
390390
},
391391
Object {
392-
"path": "apps/remote2/project.json",
392+
"path": "apps/remote2/.prettierignore",
393393
"type": "CREATE",
394394
},
395395
Object {
396-
"path": "apps/remote2/.eslintrc.json",
396+
"path": "apps/remote2/package.json",
397397
"type": "CREATE",
398398
},
399399
Object {
400-
"path": "apps/remote2/.prettierignore",
400+
"path": "apps/remote2/project.json",
401401
"type": "CREATE",
402402
},
403403
Object {
404-
"path": "apps/remote2/README.md",
404+
"path": "apps/remote2/public/favicon.svg",
405405
"type": "CREATE",
406406
},
407407
Object {
408-
"path": "apps/remote2/package.json",
408+
"path": "apps/remote2/public/manifest.json",
409409
"type": "CREATE",
410410
},
411411
Object {
412-
"path": "apps/remote2/public/favicon.svg",
412+
"path": "apps/remote2/public/robots.txt",
413413
"type": "CREATE",
414414
},
415415
Object {
416-
"path": "apps/remote2/public/manifest.json",
416+
"path": "apps/remote2/README.md",
417417
"type": "CREATE",
418418
},
419419
Object {
420-
"path": "apps/remote2/public/robots.txt",
420+
"path": "apps/remote2/src/components/.gitkeep",
421421
"type": "CREATE",
422422
},
423423
Object {
@@ -444,6 +444,10 @@ Array [
444444
"path": "apps/remote2/src/root.tsx",
445445
"type": "CREATE",
446446
},
447+
Object {
448+
"path": "apps/remote2/src/routes/about/index.tsx",
449+
"type": "CREATE",
450+
},
447451
Object {
448452
"path": "apps/remote2/src/routes/index.tsx",
449453
"type": "CREATE",
@@ -473,23 +477,19 @@ Array [
473477
"type": "CREATE",
474478
},
475479
Object {
476-
"path": "apps/remote2/src/components/.gitkeep",
477-
"type": "CREATE",
478-
},
479-
Object {
480-
"path": "apps/remote2/src/routes/about/index.tsx",
480+
"path": "libs/.gitignore",
481481
"type": "CREATE",
482482
},
483483
Object {
484-
"path": "apps/myhostapp/src/components/remote-mfe/remote-mfe.tsx",
484+
"path": "nx.json",
485485
"type": "CREATE",
486486
},
487487
Object {
488-
"path": "apps/myhostapp/src/routes/about/index.tsx",
488+
"path": "package.json",
489489
"type": "CREATE",
490490
},
491491
Object {
492-
"path": "apps/myhostapp/src/config/remotes.json",
492+
"path": "tsconfig.base.json",
493493
"type": "CREATE",
494494
},
495495
]

packages/qwik-nx/src/generators/host/generator.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ describe('host generator', () => {
3838
appTree.read('apps/myhostapp/project.json', 'utf-8')
3939
).toMatchSnapshot();
4040
expect(
41-
appTree.listChanges().map((c) => ({ path: c.path, type: c.type }))
41+
[...appTree.listChanges()]
42+
.sort((a, b) => a.path.localeCompare(b.path))
43+
.map((c) => ({ path: c.path, type: c.type }))
4244
).toMatchSnapshot();
4345

4446
// remote snapshots

0 commit comments

Comments
 (0)