@blockquote/create-wc 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/common-linting/templates/package.json +2 -2
- package/src/common-repo/templates/gitignore +2 -1
- package/src/common-testing-wtr/templates/static/web-test-runner.config.mjs +1 -0
- package/src/testing/templates/my-el.test.js +7 -7
- package/src/testing-ts/templates/my-el.test.ts +7 -7
- package/src/testing-wtr/templates/static/_web-test-runner.config.mjs +0 -67
- package/src/testing-wtr-ts/templates/static/_web-test-runner.config.mjs +0 -67
package/package.json
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"trailingComma": "all"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
|
-
"format": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\"
|
|
31
|
-
"lint": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\"
|
|
30
|
+
"format": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\" --fix --ignore-path .gitignore && prettier \"**/*.{js,ts,json,html,md}\" --write --ignore-path .gitignore",
|
|
31
|
+
"lint": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\" --ignore-path .gitignore && prettier \"**/*.{js,ts,json,html,md}\" --check --ignore-path .gitignore"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"eslint": "^8.0.0",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
## testing
|
|
14
14
|
/coverage/
|
|
15
15
|
**/coverage/
|
|
16
|
+
/reports/
|
|
16
17
|
__snapshots__
|
|
17
18
|
|
|
18
19
|
## temp folders
|
|
@@ -33,4 +34,4 @@ storybook-static
|
|
|
33
34
|
/packages/*/build
|
|
34
35
|
/packages/*/node_modules
|
|
35
36
|
/packages/*/.editorconfig
|
|
36
|
-
/packages/*/.gitignore
|
|
37
|
+
/packages/*/.gitignore
|
|
@@ -13,18 +13,18 @@ suite('<%= className %>', () => {
|
|
|
13
13
|
await el.updateComplete;
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
test('has a default heading "Hey there" and counter 5',
|
|
16
|
+
test('has a default heading "Hey there" and counter 5', () => {
|
|
17
17
|
assert.equal(el.heading, 'Hey there');
|
|
18
18
|
assert.equal(el.counter, 5);
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
suite('Semantic Dom and a11y', () => {
|
|
22
|
-
test('SHADOW DOM - Structure test', () => {
|
|
23
|
-
assert.shadowDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
|
|
22
|
+
test('SHADOW DOM - Structure test', async () => {
|
|
23
|
+
await assert.shadowDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
test('LIGHT DOM - Structure test', () => {
|
|
27
|
-
assert.lightDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
|
|
26
|
+
test('LIGHT DOM - Structure test', async () => {
|
|
27
|
+
await assert.lightDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
|
|
28
28
|
});
|
|
29
29
|
test('a11y', async () => {
|
|
30
30
|
await assert.isAccessible(el);
|
|
@@ -38,7 +38,7 @@ suite('<%= className %>', () => {
|
|
|
38
38
|
await el.updateComplete;
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
test('increases the counter on button click',
|
|
41
|
+
test('increases the counter on button click', () => {
|
|
42
42
|
el.shadowRoot.querySelector('button').click();
|
|
43
43
|
assert.equal(el.counter, 6);
|
|
44
44
|
});
|
|
@@ -50,7 +50,7 @@ suite('<%= className %>', () => {
|
|
|
50
50
|
await el.updateComplete;
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
test('can override the heading via attribute',
|
|
53
|
+
test('can override the heading via attribute', () => {
|
|
54
54
|
assert.equal(el.heading, 'attribute heading');
|
|
55
55
|
});
|
|
56
56
|
});
|
|
@@ -15,18 +15,18 @@ suite('<%= className %>', () => {
|
|
|
15
15
|
await el.updateComplete;
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
test('has a default heading "Hey there" and counter 5',
|
|
18
|
+
test('has a default heading "Hey there" and counter 5', () => {
|
|
19
19
|
assert.equal(el.heading, 'Hey there');
|
|
20
20
|
assert.equal(el.counter, 5);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
suite('Semantic Dom and a11y', () => {
|
|
24
|
-
test('SHADOW DOM - Structure test', () => {
|
|
25
|
-
assert.shadowDom.equalSnapshot(el);
|
|
24
|
+
test('SHADOW DOM - Structure test', async () => {
|
|
25
|
+
await assert.shadowDom.equalSnapshot(el);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
test('LIGHT DOM - Structure test', () => {
|
|
29
|
-
assert.lightDom.equalSnapshot(el);
|
|
28
|
+
test('LIGHT DOM - Structure test', async () => {
|
|
29
|
+
await assert.lightDom.equalSnapshot(el);
|
|
30
30
|
});
|
|
31
31
|
test('a11y', async () => {
|
|
32
32
|
await assert.isAccessible(el);
|
|
@@ -40,7 +40,7 @@ suite('<%= className %>', () => {
|
|
|
40
40
|
await el.updateComplete;
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
test('increases the counter on button click',
|
|
43
|
+
test('increases the counter on button click', () => {
|
|
44
44
|
const button = el.shadowRoot!.querySelector('button')!;
|
|
45
45
|
button.click();
|
|
46
46
|
assert.equal(el.counter, 6);
|
|
@@ -55,7 +55,7 @@ suite('<%= className %>', () => {
|
|
|
55
55
|
await el.updateComplete;
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
test('can override the heading via attribute',
|
|
58
|
+
test('can override the heading via attribute', () => {
|
|
59
59
|
assert.equal(el.heading, 'attribute heading');
|
|
60
60
|
});
|
|
61
61
|
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
|
|
3
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
4
|
-
import { defaultReporter } from '@web/test-runner';
|
|
5
|
-
import { mochaStyleReporter } from '@blockquote/test-runner-mocha-style-reporter';
|
|
6
|
-
|
|
7
|
-
const filteredLogs = ['in dev mode'];
|
|
8
|
-
|
|
9
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
10
|
-
/** Test files to run */
|
|
11
|
-
files: 'test/**/*.test.js',
|
|
12
|
-
|
|
13
|
-
/** Resolve bare module imports */
|
|
14
|
-
nodeResolve: {
|
|
15
|
-
exportConditions: ['browser', 'development'],
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
reporters: [
|
|
19
|
-
defaultReporter(),
|
|
20
|
-
mochaStyleReporter(),
|
|
21
|
-
],
|
|
22
|
-
|
|
23
|
-
coverageConfig: {
|
|
24
|
-
report: true,
|
|
25
|
-
reportDir: 'test/coverage',
|
|
26
|
-
threshold: {
|
|
27
|
-
statements: 80,
|
|
28
|
-
branches: 80,
|
|
29
|
-
functions: 80,
|
|
30
|
-
lines: 80,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
testFramework: {
|
|
35
|
-
config: {
|
|
36
|
-
ui: 'tdd',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/** Filter out lit dev mode logs */
|
|
41
|
-
filterBrowserLogs(log) {
|
|
42
|
-
for (const arg of log.args) {
|
|
43
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
51
|
-
// esbuildTarget: 'auto',
|
|
52
|
-
|
|
53
|
-
/** Amount of browsers to run concurrently */
|
|
54
|
-
// concurrentBrowsers: 2,
|
|
55
|
-
|
|
56
|
-
/** Amount of test files per browser to test concurrently */
|
|
57
|
-
// concurrency: 1,
|
|
58
|
-
|
|
59
|
-
/** Browsers to run tests on */
|
|
60
|
-
// browsers: [
|
|
61
|
-
// playwrightLauncher({ product: 'chromium' }),
|
|
62
|
-
// playwrightLauncher({ product: 'firefox' }),
|
|
63
|
-
// playwrightLauncher({ product: 'webkit' }),
|
|
64
|
-
// ],
|
|
65
|
-
|
|
66
|
-
// See documentation for all available options
|
|
67
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
|
|
3
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
4
|
-
import { defaultReporter } from '@web/test-runner';
|
|
5
|
-
import { mochaStyleReporter } from '@blockquote/test-runner-mocha-style-reporter';
|
|
6
|
-
|
|
7
|
-
const filteredLogs = ['in dev mode'];
|
|
8
|
-
|
|
9
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
10
|
-
/** Test files to run */
|
|
11
|
-
files: 'dist/test/**/*.test.js',
|
|
12
|
-
|
|
13
|
-
/** Resolve bare module imports */
|
|
14
|
-
nodeResolve: {
|
|
15
|
-
exportConditions: ['browser', 'development'],
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
reporters: [
|
|
19
|
-
defaultReporter(),
|
|
20
|
-
mochaStyleReporter(),
|
|
21
|
-
],
|
|
22
|
-
|
|
23
|
-
coverageConfig: {
|
|
24
|
-
report: true,
|
|
25
|
-
reportDir: 'dist/test/coverage',
|
|
26
|
-
threshold: {
|
|
27
|
-
statements: 80,
|
|
28
|
-
branches: 80,
|
|
29
|
-
functions: 80,
|
|
30
|
-
lines: 80,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
testFramework: {
|
|
35
|
-
config: {
|
|
36
|
-
ui: 'tdd',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/** Filter out lit dev mode logs */
|
|
41
|
-
filterBrowserLogs(log) {
|
|
42
|
-
for (const arg of log.args) {
|
|
43
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
51
|
-
// esbuildTarget: 'auto',
|
|
52
|
-
|
|
53
|
-
/** Amount of browsers to run concurrently */
|
|
54
|
-
// concurrentBrowsers: 2,
|
|
55
|
-
|
|
56
|
-
/** Amount of test files per browser to test concurrently */
|
|
57
|
-
// concurrency: 1,
|
|
58
|
-
|
|
59
|
-
/** Browsers to run tests on */
|
|
60
|
-
// browsers: [
|
|
61
|
-
// playwrightLauncher({ product: 'chromium' }),
|
|
62
|
-
// playwrightLauncher({ product: 'firefox' }),
|
|
63
|
-
// playwrightLauncher({ product: 'webkit' }),
|
|
64
|
-
// ],
|
|
65
|
-
|
|
66
|
-
// See documentation for all available options
|
|
67
|
-
});
|