Skip to content

Commit e5ba21a

Browse files
kinda working
Signed-off-by: Leah <[email protected]>
1 parent 4dbe0fa commit e5ba21a

File tree

4 files changed

+612
-268
lines changed

4 files changed

+612
-268
lines changed

packages/cli/jest.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* For a detailed explanation regarding each configuration property, visit:
3+
* https://jestjs.io/docs/configuration
4+
*/
5+
6+
module.exports = {
7+
// All imported modules in your tests should be mocked automatically
8+
automock: false,
9+
10+
// Stop running tests after `n` failures
11+
bail: 0,
12+
13+
// Automatically clear mock calls and instances between every test
14+
clearMocks: true,
15+
16+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
17+
modulePathIgnorePatterns: [
18+
'<rootDir>/tests/output',
19+
'<rootDir>/tests/subjects',
20+
],
21+
22+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
23+
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
24+
25+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
26+
testPathIgnorePatterns: [
27+
'\\\\node_modules\\\\',
28+
'<rootDir>/tests/output',
29+
'<rootDir>/tests/subjects',
30+
],
31+
32+
// This option allows use of a custom test runner
33+
// testRunner: "jest-circus/runner",
34+
};

packages/cli/package.json

Lines changed: 148 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,164 +1,150 @@
11
{
2-
"name": "preact-cli",
3-
"version": "3.1.0",
4-
"description": "Start building a Preact Progressive Web App in seconds.",
5-
"repository": "preactjs/preact-cli",
6-
"main": "lib/index.js",
7-
"bin": {
8-
"preact": "lib/index.js"
9-
},
10-
"scripts": {
11-
"pretest": "rimraf ./tests/output",
12-
"test": "jest --forceExit --bail"
13-
},
14-
"jest": {
15-
"setupFilesAfterEnv": [
16-
"<rootDir>/tests/setup.js"
17-
],
18-
"testEnvironment": "node",
19-
"testPathIgnorePatterns": [
20-
"<rootDir>/tests/output",
21-
"<rootDir>/tests/subjects"
22-
],
23-
"modulePathIgnorePatterns": [
24-
"<rootDir>/tests/output",
25-
"<rootDir>/tests/subjects"
26-
]
27-
},
28-
"engines": {
29-
"node": ">=12"
30-
},
31-
"files": [
32-
"sw",
33-
"lib",
34-
"babel"
35-
],
36-
"keywords": [
37-
"preact",
38-
"cli",
39-
"pwa",
40-
"project",
41-
"generator"
42-
],
43-
"author": "Jason Miller <[email protected]> (http://jasonformat.com)",
44-
"license": "MIT",
45-
"bugs": "https://github.com/preactjs/preact-cli/issues",
46-
"homepage": "https://github.com/preactjs/preact-cli",
47-
"devDependencies": {
48-
"html-looks-like": "^1.0.2",
49-
"jest": "^27.0.1",
50-
"less": "^4.1.1",
51-
"less-loader": "^7.3.0",
52-
"ncp": "^2.0.0",
53-
"p-retry": "^4.5.0",
54-
"polka": "^0.5.2",
55-
"preact": "^10.5.13",
56-
"preact-render-to-string": "^5.1.19",
57-
"preact-router": "^3.0.1",
58-
"puppeteer": "^9.1.1",
59-
"sass": "^1.34.0",
60-
"sass-loader": "^10.2.0",
61-
"shelljs": "^0.8.3",
62-
"sirv": "^1.0.11",
63-
"stylus": "^0.54.8",
64-
"stylus-loader": "^4.3.3"
65-
},
66-
"peerDependencies": {
67-
"less-loader": "^7.3.0",
68-
"preact": "*",
69-
"preact-render-to-string": "*",
70-
"sass-loader": "^10.2.0",
71-
"stylus-loader": "^4.3.3"
72-
},
73-
"peerDependenciesMeta": {
74-
"less-loader": {
75-
"optional": true
76-
},
77-
"sass-loader": {
78-
"optional": true
79-
},
80-
"stylus-loader": {
81-
"optional": true
82-
}
83-
},
84-
"dependencies": {
85-
"@babel/core": "^7.13.16",
86-
"@babel/plugin-proposal-class-properties": "^7.13.0",
87-
"@babel/plugin-proposal-decorators": "^7.13.15",
88-
"@babel/plugin-proposal-object-rest-spread": "^7.13.8",
89-
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
90-
"@babel/plugin-transform-object-assign": "^7.12.13",
91-
"@babel/plugin-transform-react-jsx": "^7.13.12",
92-
"@babel/preset-env": "^7.13.15",
93-
"@babel/preset-typescript": "^7.13.0",
94-
"@preact/async-loader": "^3.0.1",
95-
"@prefresh/babel-plugin": "^0.4.1",
96-
"@prefresh/webpack": "^3.2.2",
97-
"autoprefixer": "^10.2.5",
98-
"babel-esm-plugin": "^0.9.0",
99-
"babel-loader": "^8.2.2",
100-
"babel-plugin-macros": "^3.1.0",
101-
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
102-
"browserlist": "^1.0.1",
103-
"browserslist": "^4.16.4",
104-
"compression-webpack-plugin": "^6.0.4",
105-
"console-clear": "^1.0.0",
106-
"copy-webpack-plugin": "^6.2.1",
107-
"critters-webpack-plugin": "^2.5.0",
108-
"cross-spawn-promise": "^0.10.1",
109-
"css-loader": "^5.2.4",
110-
"ejs-loader": "^0.5.0",
111-
"envinfo": "^7.8.1",
112-
"esm": "^3.2.25",
113-
"fast-async": "^6.3.7",
114-
"file-loader": "^6.2.0",
115-
"fork-ts-checker-webpack-plugin": "^5.2.1",
116-
"get-port": "^5.0.0",
117-
"gittar": "^0.1.0",
118-
"glob": "^7.1.4",
119-
"html-webpack-exclude-assets-plugin": "0.0.7",
120-
"html-webpack-plugin": "^3.2.0",
121-
"ip": "^1.1.5",
122-
"isomorphic-unfetch": "^3.1.0",
123-
"kleur": "^4.1.4",
124-
"loader-utils": "^2.0.0",
125-
"mini-css-extract-plugin": "^1.5.0",
126-
"minimatch": "^3.0.3",
127-
"native-url": "0.3.4",
128-
"optimize-css-assets-webpack-plugin": "^5.0.1",
129-
"ora": "^5.4.0",
130-
"pnp-webpack-plugin": "^1.6.4",
131-
"postcss": "^8.2.10",
132-
"postcss-load-config": "^3.0.1",
133-
"postcss-loader": "^4.0.4",
134-
"progress-bar-webpack-plugin": "^2.1.0",
135-
"promise-polyfill": "^8.2.0",
136-
"prompts": "^2.4.1",
137-
"raw-loader": "^4.0.2",
138-
"react-refresh": "0.9.0",
139-
"rimraf": "^3.0.2",
140-
"sade": "^1.7.4",
141-
"size-plugin": "^2.0.1",
142-
"source-map": "^0.7.2",
143-
"stack-trace": "0.0.10",
144-
"style-loader": "^2.0.0",
145-
"terser-webpack-plugin": "^3.0.3",
146-
"typescript": "^4.2.4",
147-
"update-notifier": "^5.1.0",
148-
"url-loader": "^4.1.1",
149-
"validate-npm-package-name": "^3.0.0",
150-
"webpack": "^4.38.0",
151-
"webpack-bundle-analyzer": "^3.3.2",
152-
"webpack-dev-server": "^3.11.2",
153-
"webpack-fix-style-only-entries": "^0.6.1",
154-
"webpack-merge": "^5.3.0",
155-
"webpack-plugin-replace": "^1.2.0",
156-
"which": "^2.0.2",
157-
"workbox-cacheable-response": "^6.1.5",
158-
"workbox-core": "^6.1.5",
159-
"workbox-precaching": "^6.1.5",
160-
"workbox-routing": "^6.1.5",
161-
"workbox-strategies": "^6.1.5",
162-
"workbox-webpack-plugin": "^6.1.5"
163-
}
2+
"name": "preact-cli",
3+
"version": "3.1.0",
4+
"description": "Start building a Preact Progressive Web App in seconds.",
5+
"repository": "preactjs/preact-cli",
6+
"main": "lib/index.js",
7+
"bin": {
8+
"preact": "lib/index.js"
9+
},
10+
"scripts": {
11+
"pretest": "rimraf ./tests/output",
12+
"test": "jest"
13+
},
14+
"engines": {
15+
"node": ">=12"
16+
},
17+
"files": [
18+
"sw",
19+
"lib",
20+
"babel"
21+
],
22+
"keywords": [
23+
"preact",
24+
"cli",
25+
"pwa",
26+
"project",
27+
"generator"
28+
],
29+
"author": "Jason Miller <[email protected]> (http://jasonformat.com)",
30+
"license": "MIT",
31+
"bugs": "https://github.com/preactjs/preact-cli/issues",
32+
"homepage": "https://github.com/preactjs/preact-cli",
33+
"devDependencies": {
34+
"html-looks-like": "^1.0.2",
35+
"jest": "^27.0.1",
36+
"less": "^4.1.1",
37+
"less-loader": "^7.3.0",
38+
"ncp": "^2.0.0",
39+
"p-retry": "^4.5.0",
40+
"polka": "^0.5.2",
41+
"preact": "^10.5.13",
42+
"preact-render-to-string": "^5.1.19",
43+
"preact-router": "^3.0.1",
44+
"puppeteer": "^9.1.1",
45+
"sass": "^1.34.0",
46+
"sass-loader": "^10.2.0",
47+
"shelljs": "^0.8.3",
48+
"sirv": "^1.0.11",
49+
"stylus": "^0.54.8",
50+
"stylus-loader": "^4.3.3"
51+
},
52+
"peerDependencies": {
53+
"less-loader": "^7.3.0",
54+
"preact": "*",
55+
"preact-render-to-string": "*",
56+
"sass-loader": "^10.2.0",
57+
"stylus-loader": "^4.3.3"
58+
},
59+
"peerDependenciesMeta": {
60+
"less-loader": {
61+
"optional": true
62+
},
63+
"sass-loader": {
64+
"optional": true
65+
},
66+
"stylus-loader": {
67+
"optional": true
68+
}
69+
},
70+
"dependencies": {
71+
"@babel/core": "^7.13.16",
72+
"@babel/plugin-proposal-class-properties": "^7.13.0",
73+
"@babel/plugin-proposal-decorators": "^7.13.15",
74+
"@babel/plugin-proposal-object-rest-spread": "^7.13.8",
75+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
76+
"@babel/plugin-transform-object-assign": "^7.12.13",
77+
"@babel/plugin-transform-react-jsx": "^7.13.12",
78+
"@babel/preset-env": "^7.13.15",
79+
"@babel/preset-typescript": "^7.13.0",
80+
"@preact/async-loader": "^3.0.1",
81+
"@prefresh/babel-plugin": "^0.4.1",
82+
"@prefresh/webpack": "^3.2.2",
83+
"autoprefixer": "^10.2.5",
84+
"babel-esm-plugin": "^0.9.0",
85+
"babel-loader": "^8.2.2",
86+
"babel-plugin-macros": "^3.1.0",
87+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
88+
"browserlist": "^1.0.1",
89+
"browserslist": "^4.16.4",
90+
"compression-webpack-plugin": "^6.0.4",
91+
"console-clear": "^1.0.0",
92+
"copy-webpack-plugin": "^6.2.1",
93+
"critters-webpack-plugin": "^2.5.0",
94+
"cross-spawn-promise": "^0.10.1",
95+
"css-loader": "^5.2.4",
96+
"ejs-loader": "^0.5.0",
97+
"envinfo": "^7.8.1",
98+
"esm": "^3.2.25",
99+
"fast-async": "^6.3.7",
100+
"file-loader": "^6.2.0",
101+
"fork-ts-checker-webpack-plugin": "^6.2.10",
102+
"get-port": "^5.0.0",
103+
"gittar": "^0.1.0",
104+
"glob": "^7.1.4",
105+
"html-webpack-exclude-assets-plugin": "0.0.7",
106+
"html-webpack-plugin": "^3.2.0",
107+
"ip": "^1.1.5",
108+
"isomorphic-unfetch": "^3.1.0",
109+
"kleur": "^4.1.4",
110+
"loader-utils": "^2.0.0",
111+
"mini-css-extract-plugin": "^1.5.0",
112+
"minimatch": "^3.0.3",
113+
"native-url": "0.3.4",
114+
"optimize-css-assets-webpack-plugin": "^6.0.0",
115+
"ora": "^5.4.0",
116+
"pnp-webpack-plugin": "^1.6.4",
117+
"postcss": "^8.2.10",
118+
"postcss-load-config": "^3.0.1",
119+
"postcss-loader": "^4.0.4",
120+
"progress-bar-webpack-plugin": "^2.1.0",
121+
"promise-polyfill": "^8.2.0",
122+
"prompts": "^2.4.1",
123+
"raw-loader": "^4.0.2",
124+
"react-refresh": "0.10.0",
125+
"rimraf": "^3.0.2",
126+
"sade": "^1.7.4",
127+
"size-plugin": "^3.0.0",
128+
"source-map": "^0.7.2",
129+
"stack-trace": "0.0.10",
130+
"style-loader": "^2.0.0",
131+
"terser-webpack-plugin": "^4.2.3",
132+
"typescript": "^4.2.4",
133+
"update-notifier": "^5.1.0",
134+
"url-loader": "^4.1.1",
135+
"validate-npm-package-name": "^3.0.0",
136+
"webpack": "^4.38.0",
137+
"webpack-bundle-analyzer": "^4.4.2",
138+
"webpack-dev-server": "^3.11.2",
139+
"webpack-fix-style-only-entries": "^0.6.1",
140+
"webpack-merge": "^5.3.0",
141+
"webpack-plugin-replace": "^1.2.0",
142+
"which": "^2.0.2",
143+
"workbox-cacheable-response": "^6.1.5",
144+
"workbox-core": "^6.1.5",
145+
"workbox-precaching": "^6.1.5",
146+
"workbox-routing": "^6.1.5",
147+
"workbox-strategies": "^6.1.5",
148+
"workbox-webpack-plugin": "^6.1.5"
149+
}
164150
}

packages/cli/tests/service-worker.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ describe('preact service worker tests', () => {
4141
await browser.close();
4242
});
4343

44-
afterAll(async () => {
45-
await server.server.stop();
44+
afterAll(() => {
45+
server.server.close();
4646
});
4747

4848
it('works offline', async () => {

0 commit comments

Comments
 (0)