@daiyam/artifact-vsx-test-mocha 0.1.0

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.
@@ -0,0 +1,44 @@
1
+ $schema: https://raw.githubusercontent.com/zokugun/artifact/v0.6.0/schemas/v1/package.json
2
+
3
+ update:
4
+ package.json:
5
+ route:
6
+ $$extend: package
7
+ patches:
8
+ - op: replace
9
+ path: /map(compose)/devDependencies/map(sort)
10
+ value:
11
+ map(filter):
12
+ '@zokugun/fs-extra-plus':
13
+ if_missing: skip
14
+ '@zokugun/xtry':
15
+ if_missing: skip
16
+ yaml:
17
+ if_missing: skip
18
+ $$default: primitive
19
+
20
+ test/*.ts:
21
+ if_missing: skip
22
+ if_exists: skip
23
+
24
+ uninstall:
25
+ .test:
26
+ if_exists: remove
27
+
28
+ .vscode/launch.json:
29
+ if_exists: unmerge
30
+
31
+ .vscode/settings.json:
32
+ if_exists: unmerge
33
+
34
+ .vscode-test:
35
+ if_exists: remove
36
+
37
+ .vscode-test.mjs:
38
+ if_exists: remove
39
+
40
+ .xo-config.json:
41
+ if_exists: unmerge
42
+
43
+ package.json:
44
+ if_exists: unmerge
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2026-present Baptiste Augrain
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ [@daiyam/artifact-vsx-test-mocha](https://github.com/daiyam/artifact-configs/tree/master/packages/vsx-test-mocha)
2
+ =================================================================================================================
3
+
4
+ [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
5
+ [![NPM Version](https://img.shields.io/npm/v/@daiyam/artifact-vsx-test-mocha.svg?colorB=green)](https://www.npmjs.com/package/@daiyam/artifact-vsx-test-mocha)
6
+
7
+ The configuration to do unit testing for VSCode extensions.
8
+
9
+ Getting Started
10
+ ---------------
11
+
12
+ ```sh
13
+ mkdir myproject
14
+ cd myproject
15
+ npm init -y
16
+ artifact add @daiyam/lang-js @daiyam/lang-ts @daiyam/vsx-ts @daiyam/vsx-test-mocha
17
+ ```
18
+
19
+ License
20
+ -------
21
+
22
+ Copyright © 2026-present Baptiste Augrain
23
+
24
+ Licensed under the [MIT license](https://opensource.org/licenses/MIT).
@@ -0,0 +1,27 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Run Extension",
6
+ "type": "extensionHost",
7
+ "request": "launch",
8
+ "runtimeExecutable": "${execPath}",
9
+ "args": [
10
+ "--extensionDevelopmentPath=${workspaceFolder}"
11
+ ],
12
+ "outFiles": [
13
+ "${workspaceFolder}/lib/**/*.js"
14
+ ],
15
+ "preLaunchTask": "npm: watch:src"
16
+ },
17
+ {
18
+ "name": "Run Unit Tests",
19
+ "type": "extensionHost",
20
+ "request": "launch",
21
+ "testConfiguration": "${workspaceFolder}/.vscode-test.mjs",
22
+ "args": [
23
+ "--extensionDevelopmentPath=${workspaceFolder}"
24
+ ]
25
+ },
26
+ ]
27
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "search.exclude": {
3
+ ".test/**": true,
4
+ ".vscode-test/**": true,
5
+ },
6
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from '@vscode/test-cli'
2
+
3
+ export default defineConfig({
4
+ files: '.test/test/**/*.test.js',
5
+ mocha: {
6
+ ui: 'bdd',
7
+ timeout: 20000
8
+ },
9
+ })
@@ -0,0 +1,17 @@
1
+ {
2
+ "ignores": [
3
+ "test/fixtures"
4
+ ],
5
+ "plugins": [
6
+ "chai-friendly"
7
+ ],
8
+ "overrides": [
9
+ {
10
+ "files": "**/*.test.ts",
11
+ "rules": {
12
+ "@typescript-eslint/no-unused-expressions": "off",
13
+ "chai-friendly/no-unused-expressions": "error"
14
+ }
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,2 @@
1
+ /.test/
2
+ /.vscode-test/
@@ -0,0 +1,27 @@
1
+ {
2
+ "scripts": {
3
+ "clean": "rimraf .test .vscode-test",
4
+ "test": "tsc -p test && vscode-test",
5
+ "test:dev": "vscode-test",
6
+ "test:watch": "tsc-watch -p src -p test --onSuccess 'vscode-test'",
7
+ "watch:test": "tsc-watch -p test"
8
+ },
9
+ "devDependencies": {
10
+ "@types/chai": "5.2.3",
11
+ "@types/mocha": "10.0.10",
12
+ "@vscode/test-cli": "0.0.12",
13
+ "@vscode/test-electron": "2.5.2",
14
+ "@zokugun/fs-extra-plus": "0.5.0",
15
+ "@zokugun/xtry": "0.11.6",
16
+ "chai": "6.2.2",
17
+ "eslint-plugin-chai-friendly": "1.2.0",
18
+ "mocha": "11.7.6",
19
+ "yaml": "2.9.0"
20
+ },
21
+ "overrides": {
22
+ "mocha": {
23
+ "diff": "8.0.3",
24
+ "serialize-javascript": "7.0.5"
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,7 @@
1
+ import { expect } from 'chai';
2
+
3
+ describe('default', () => {
4
+ it('default', async () => { // {{{
5
+ expect(true).to.eql(true);
6
+ }); // }}}
7
+ });
@@ -0,0 +1,49 @@
1
+ import fse from '@zokugun/fs-extra-plus/sync';
2
+ import { xtry } from '@zokugun/xtry/sync';
3
+ import { expect } from 'chai';
4
+ import YAML from 'yaml';
5
+
6
+ describe('fold', () => {
7
+ function prepare(file: string) {
8
+ const name = fse.leafName(file, 1);
9
+
10
+ it(name, () => {
11
+ const content = fse.readFile(file, 'utf8');
12
+ if(content.fails) {
13
+ throw content.error;
14
+ }
15
+
16
+ const document = xtry(() => YAML.parse(content.value) as unknown);
17
+ if(document.fails) {
18
+ throw document.error;
19
+ }
20
+
21
+ const result = doSomething(document.value);
22
+
23
+ try {
24
+ expect(result).to.eql(expected);
25
+ }
26
+ catch (error) {
27
+ console.log(YAML.stringify(result));
28
+
29
+ throw error;
30
+ }
31
+ });
32
+ }
33
+
34
+ const files = fse.walk(fse.join(__dirname, '..', '..', 'test', 'fixtures'), {
35
+ absolute: true,
36
+ collect: true,
37
+ onlyFiles: true,
38
+ traverseAll: true,
39
+ filter: (item) => !item.path.endsWith('.yml'),
40
+ });
41
+
42
+ if(files.fails) {
43
+ throw files.error;
44
+ }
45
+
46
+ for(const file of files.value) {
47
+ prepare(file.path);
48
+ }
49
+ });
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ /* Basic Options */
5
+ "outDir": "../.test", /* Specify an output folder for all emitted files. */
6
+ "rootDir": "..", /* Specify the root directory of input files. */
7
+
8
+ /* Source Map Options */
9
+ "sourceMap": true, /* Create source map files for emitted JavaScript files. */
10
+ },
11
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@daiyam/artifact-vsx-test-mocha",
3
+ "version": "0.1.0",
4
+ "description": "The configuration to do unit testing for VSCode extensions.",
5
+ "author": {
6
+ "name": "Baptiste Augrain",
7
+ "email": "daiyam@zokugun.org"
8
+ },
9
+ "license": "MIT",
10
+ "homepage": "https://github.com/daiyam/artifact-configs/tree/master/packages/vsx-test-mocha",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/daiyam/artifact-configs.git"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/daiyam/artifact-configs/issues"
17
+ },
18
+ "keywords": [
19
+ "artifact",
20
+ "boilerplate",
21
+ "boilerplates",
22
+ "codegeneration",
23
+ "codemod",
24
+ "codemods",
25
+ "configuration",
26
+ "configurations",
27
+ "generate",
28
+ "generator",
29
+ "project-generator",
30
+ "project-starter",
31
+ "project-template",
32
+ "scaffold"
33
+ ],
34
+ "gitHead": "19805320925f3b643ce19109bb14768660059465"
35
+ }