Skip to content

Commit 241e189

Browse files
committed
Update tests (pt. 2)
1 parent 1bf0894 commit 241e189

File tree

46 files changed

+4332
-884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4332
-884
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ jobs:
1010
- name: Run compiler
1111
run: yarn compile
1212
- name: Run `extenion build` command
13-
run: yarn test:build
13+
run: EXTENSION_ENV=development yarn test:build
14+

.github/workflows/ci.yml renamed to .github/workflows/develop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Core Plugin
22
on: push
33
jobs:
44
build:
@@ -9,5 +9,5 @@ jobs:
99
run: yarn
1010
- name: Run compiler
1111
run: yarn compile
12-
- name: Run tests
12+
- name: Run core webpack plugin tests
1313
run: yarn test

aaa.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

examples/action-chatgpt/yarn.lock

Lines changed: 990 additions & 0 deletions
Large diffs are not rendered by default.

examples/content-extension-config/yarn.lock

Lines changed: 2434 additions & 0 deletions
Large diffs are not rendered by default.

examples/content-preact/babel.config.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/data.ts

Lines changed: 89 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DevOptions } from 'extension-develop'
1+
import {DevOptions} from 'extension-develop'
22
import {type Template} from './types'
33

44
const DEFAULT_TEMPLATE: Template = {
@@ -30,20 +30,20 @@ const JS_TEMPLATES: Template[] = [
3030
// hasEnv: false,
3131
// configFiles: ['babel.config.json']
3232
// },
33-
// {
34-
// name: 'content-extension-config',
35-
// uiContext: ['content'],
36-
// uiFramework: 'react',
37-
// css: 'css',
38-
// hasBackground: true,
39-
// hasEnv: false,
40-
// configFiles: [
41-
// 'extension.config.js',
42-
// 'tsconfig.json',
43-
// 'postcss.config.js',
44-
// 'tailwind.config.js'
45-
// ]
46-
// },
33+
{
34+
name: 'content-extension-config',
35+
uiContext: ['content'],
36+
uiFramework: 'react',
37+
css: 'css',
38+
hasBackground: true,
39+
hasEnv: false,
40+
configFiles: [
41+
'extension.config.js',
42+
'tsconfig.json',
43+
'postcss.config.js',
44+
'tailwind.config.js'
45+
]
46+
},
4747
{
4848
name: 'config-stylelint',
4949
uiContext: ['newTab'],
@@ -214,15 +214,15 @@ const TS_TEMPLATES: Template[] = [
214214
]
215215

216216
const CUSTOM_TEMPLATES: Template[] = [
217-
// {
218-
// name: 'action-chatgpt',
219-
// uiContext: ['action'],
220-
// uiFramework: 'react',
221-
// css: 'css',
222-
// hasBackground: false,
223-
// hasEnv: true,
224-
// configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
225-
// }
217+
{
218+
name: 'action-chatgpt',
219+
uiContext: ['action'],
220+
uiFramework: 'react',
221+
css: 'css',
222+
hasBackground: false,
223+
hasEnv: true,
224+
configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
225+
}
226226
]
227227

228228
const FRAMEWORK_TEMPLATES: Template[] = [
@@ -235,33 +235,33 @@ const FRAMEWORK_TEMPLATES: Template[] = [
235235
hasEnv: false,
236236
configFiles: ['tsconfig.json']
237237
},
238-
// {
239-
// name: 'content-react',
240-
// uiContext: ['content'],
241-
// uiFramework: 'react',
242-
// css: 'css',
243-
// hasBackground: false,
244-
// hasEnv: false,
245-
// configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
246-
// },
247-
// {
248-
// name: 'new-preact',
249-
// uiContext: ['newTab'],
250-
// uiFramework: 'preact',
251-
// css: 'css',
252-
// hasBackground: false,
253-
// hasEnv: false,
254-
// configFiles: ['tsconfig.json']
255-
// },
256-
// {
257-
// name: 'content-preact',
258-
// uiContext: ['content'],
259-
// uiFramework: 'preact',
260-
// css: 'css',
261-
// hasBackground: false,
262-
// hasEnv: false,
263-
// configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
264-
// },
238+
{
239+
name: 'content-react',
240+
uiContext: ['content'],
241+
uiFramework: 'react',
242+
css: 'css',
243+
hasBackground: false,
244+
hasEnv: false,
245+
configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
246+
},
247+
{
248+
name: 'new-preact',
249+
uiContext: ['newTab'],
250+
uiFramework: 'preact',
251+
css: 'css',
252+
hasBackground: false,
253+
hasEnv: false,
254+
configFiles: ['tsconfig.json']
255+
},
256+
{
257+
name: 'content-preact',
258+
uiContext: ['content'],
259+
uiFramework: 'preact',
260+
css: 'css',
261+
hasBackground: false,
262+
hasEnv: false,
263+
configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
264+
},
265265
{
266266
name: 'new-vue',
267267
uiContext: ['newTab'],
@@ -270,40 +270,49 @@ const FRAMEWORK_TEMPLATES: Template[] = [
270270
hasBackground: false,
271271
hasEnv: false,
272272
configFiles: ['tsconfig.json']
273+
},
274+
{
275+
name: 'content-vue',
276+
uiContext: ['content'],
277+
uiFramework: 'vue',
278+
css: 'css',
279+
hasBackground: false,
280+
hasEnv: false,
281+
configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
273282
}
274-
// {
275-
// name: 'content-vue',
276-
// uiContext: ['content'],
277-
// uiFramework: 'vue',
278-
// css: 'css',
279-
// hasBackground: false,
280-
// hasEnv: false,
281-
// configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
282-
// }
283283
]
284284

285285
const TAILWIND_TEMPLATES: Template[] = [
286+
{
287+
name: 'content-tailwind',
288+
uiContext: ['content'],
289+
uiFramework: undefined,
290+
css: 'css',
291+
hasBackground: false,
292+
hasEnv: false,
293+
configFiles: ['tailwind.config.js', 'postcss.config.js', 'tsconfig.json']
294+
},
295+
{
296+
name: 'new-tailwind',
297+
uiContext: ['newTab'],
298+
uiFramework: 'react',
299+
css: 'css',
300+
hasBackground: false,
301+
hasEnv: false,
302+
configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
303+
}
304+
]
305+
306+
const ALL_TEMPLATES: Template[] = [
286307
// {
287-
// name: 'content-tailwind',
288-
// uiContext: ['newTab'],
289-
// uiFramework: undefined,
290-
// css: 'css',
291-
// hasBackground: false,
292-
// hasEnv: false,
293-
// configFiles: ['tailwind.config.js', 'postcss.config.js', 'tsconfig.json']
294-
// },
295-
// {
296-
// name: 'new-tailwind',
297-
// uiContext: ['newTab'],
298-
// uiFramework: 'react',
308+
// name: 'content-vue',
309+
// uiContext: ['content'],
310+
// uiFramework: 'vue',
299311
// css: 'css',
300312
// hasBackground: false,
301313
// hasEnv: false,
302314
// configFiles: ['postcss.config.js', 'tailwind.config.js', 'tsconfig.json']
303315
// }
304-
]
305-
306-
const ALL_TEMPLATES: Template[] = [
307316
DEFAULT_TEMPLATE,
308317
...JS_TEMPLATES,
309318
...WASM_TEMPLATES,
@@ -317,7 +326,11 @@ const ALL_TEMPLATES_BUT_DEFAULT = ALL_TEMPLATES.filter(
317326
(template) => template.name !== 'init'
318327
)
319328

320-
const SUPPORTED_BROWSERS: DevOptions['browser'][] = ['chrome', 'edge', 'firefox']
329+
const SUPPORTED_BROWSERS: DevOptions['browser'][] = [
330+
'chrome',
331+
'edge',
332+
'firefox'
333+
]
321334

322335
export {
323336
SUPPORTED_BROWSERS,

examples/new-preact/babel.config.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/special-folders-pages/pages/main.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<body>
99
<h1>Main Window</h1>
1010
<p>I am the main window. I am not sandboxed.</p>
11+
<img src="../images/notpublic-file.png" alt="Not Public File" />
1112
<iframe src="../sandbox/index.html" width="380" height="140"></iframe>
1213
<iframe src="/public/html/file.html" width="380" height="140"></iframe>
1314
<script src="./main.js"></script>

examples/special-folders-pages/sandbox/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<title>Sandboxed Content</title>
66
<link rel="stylesheet" href="../public/css/file.css" />
7+
<link rel="stylesheet" href="./styles.css" />
78
</head>
89
<body>
910
<h1>Sandboxed Content</h1>
@@ -16,6 +17,8 @@ <h1>Sandboxed Content</h1>
1617
"output of an eval-ed inline script.</p>'"
1718
);
1819
</script>
20+
<iframe src="../pages/custom.html"></iframe>
1921
<script src="./scripts.js"></script>
22+
<script src="../public/js/file.js"></script>
2023
</body>
2124
</html>

programs/cli/__spec__/cli.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {promisify} from 'util'
1212
const execAsync = promisify(exec)
1313

1414
export async function extensionProgram(command: string = '') {
15-
const cliDir = path.resolve(__dirname, '..', 'dist', 'cli.js')
16-
const cliCommand = `node ${cliDir} ${command}`
15+
const cliDirectory = path.resolve(__dirname, '..', 'dist', 'cli.js')
16+
const cliCommand = `node ${cliDirectory} ${command}`
1717
return await execAsync(cliCommand)
1818
}
1919

programs/cli/jest.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
module.exports = {
22
preset: 'ts-jest',
3-
testEnvironment: 'node',
4-
testMatch: ['**/__spec__/**/*.spec.ts']
3+
testEnvironment: 'node'
54
}

0 commit comments

Comments
 (0)