yo-unit 0.0.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.
- package/README.md +9 -0
- package/package.json +35 -0
- package/src/__tests__/GetYoUnitTest.js +9 -0
- package/src/index.js +25 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.0.0",
|
|
3
|
+
"name": "yo-unit",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/react-atomic/reshow",
|
|
7
|
+
"directory": "packages/yo-unit"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/react-atomic/reshow/tree/main/packages/yo-unit",
|
|
10
|
+
"description": "Yeoman test utility.",
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"author": "Hill <hill@kimo.com>",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"reshow-constant": "*",
|
|
16
|
+
"reshow-unit": "*",
|
|
17
|
+
"yeoman-assert": "*",
|
|
18
|
+
"yeoman-test": "*"
|
|
19
|
+
},
|
|
20
|
+
"main": "./src/index.js",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"mochaFor": "mocha",
|
|
23
|
+
"mocha": "npm run mochaFor -- 'src/**/__tests__/*.js'",
|
|
24
|
+
"test": "npm run mocha",
|
|
25
|
+
"prepublishOnly": "npm run test"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"src",
|
|
29
|
+
"package.json",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=14"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { STRING } = require("reshow-constant");
|
|
2
|
+
|
|
3
|
+
// for test
|
|
4
|
+
const YoTest = require("yeoman-test");
|
|
5
|
+
const assert = require("yeoman-assert");
|
|
6
|
+
|
|
7
|
+
const getYoUnit = () => {
|
|
8
|
+
return {
|
|
9
|
+
YoTest: ({ source, params, options = {}, build }) => {
|
|
10
|
+
source = STRING === typeof source ? PATH.join(source) : source;
|
|
11
|
+
return YoTest.create(source)
|
|
12
|
+
.withPrompts(params)
|
|
13
|
+
.withOptions(options)
|
|
14
|
+
.inTmpDir((dir) => {
|
|
15
|
+
console.log(`Build Dest on: ${dir}`);
|
|
16
|
+
console.log(`Source : ${source}`);
|
|
17
|
+
})
|
|
18
|
+
.build(build)
|
|
19
|
+
.run();
|
|
20
|
+
},
|
|
21
|
+
assert,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
module.exports = getYoUnit;
|