create-vue 3.0.4 → 3.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.
- package/outfile.cjs +100 -41
- package/package.json +7 -6
- package/template/base/.vscode/extensions.json +1 -1
- package/template/base/node_modules/.bin/vite +4 -4
- package/template/base/package.json +2 -2
- package/template/base/vite.config.js +1 -1
- package/template/code/default/src/assets/base.css +1 -1
- package/template/code/router/src/App.vue +4 -3
- package/template/code/router/src/components/HelloWorld.vue +0 -1
- package/template/code/typescript-default/src/assets/base.css +1 -1
- package/template/code/typescript-default/src/components/HelloWorld.vue +0 -1
- package/template/code/typescript-router/src/App.vue +4 -3
- package/template/code/typescript-router/src/components/HelloWorld.vue +0 -1
- package/template/{code/default → config/cypress}/cypress/integration/example.spec.js +0 -0
- package/template/config/cypress/cypress/plugins/index.js +0 -5
- package/template/config/cypress/cypress/plugins/index.ts +21 -0
- package/template/config/cypress/cypress.json +1 -5
- package/template/config/cypress/node_modules/.bin/cypress +4 -4
- package/template/config/cypress/package.json +1 -5
- package/template/config/cypress-ct/cypress/plugins/index.js +29 -0
- package/template/config/{typescript → cypress-ct}/cypress/plugins/index.ts +0 -0
- package/template/config/cypress-ct/cypress.json +7 -0
- package/template/config/cypress-ct/node_modules/.bin/cypress +17 -0
- package/template/config/cypress-ct/node_modules/.bin/vite +17 -0
- package/template/config/cypress-ct/package.json +15 -0
- package/template/{code/default → config/cypress-ct}/src/components/__tests__/HelloWorld.spec.js +0 -0
- package/template/config/jsx/vite.config.js +1 -1
- package/template/config/pinia/package.json +2 -1
- package/template/config/router/package.json +1 -0
- package/template/config/typescript/env.d.ts +0 -7
- package/template/config/typescript/package.json +1 -1
- package/template/config/vitest/node_modules/.bin/vitest +17 -0
- package/template/config/vitest/package.json +13 -0
- package/template/config/vitest/src/components/__tests__/HelloWorld.spec.js +11 -0
- package/template/config/vuex/package.json +1 -0
- package/template/code/router/cypress/integration/example.spec.js +0 -13
- package/template/code/router/src/components/__tests__/HelloWorld.spec.js +0 -13
- package/template/code/typescript-default/cypress/integration/example.spec.ts +0 -8
- package/template/code/typescript-default/src/components/__tests__/HelloWorld.spec.ts +0 -13
- package/template/code/typescript-router/cypress/integration/example.spec.ts +0 -13
- package/template/code/typescript-router/src/components/__tests__/HelloWorld.spec.ts +0 -13
package/outfile.cjs
CHANGED
|
@@ -3,8 +3,22 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
8
22
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
9
23
|
var __commonJS = (cb, mod) => function __require() {
|
|
10
24
|
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
@@ -5181,7 +5195,7 @@ var require_lib = __commonJS({
|
|
|
5181
5195
|
for (question of questions) {
|
|
5182
5196
|
({ name, type } = question);
|
|
5183
5197
|
if (typeof type === "function") {
|
|
5184
|
-
type = await type(answer, {
|
|
5198
|
+
type = await type(answer, __spreadValues({}, answers), question);
|
|
5185
5199
|
question["type"] = type;
|
|
5186
5200
|
}
|
|
5187
5201
|
if (!type)
|
|
@@ -5190,7 +5204,7 @@ var require_lib = __commonJS({
|
|
|
5190
5204
|
if (passOn.includes(key))
|
|
5191
5205
|
continue;
|
|
5192
5206
|
let value = question[key];
|
|
5193
|
-
question[key] = typeof value === "function" ? await value(answer, {
|
|
5207
|
+
question[key] = typeof value === "function" ? await value(answer, __spreadValues({}, answers), lastPrompt) : value;
|
|
5194
5208
|
}
|
|
5195
5209
|
lastPrompt = question;
|
|
5196
5210
|
if (typeof question.message !== "string") {
|
|
@@ -5377,10 +5391,7 @@ function sortDependencies(packageJson) {
|
|
|
5377
5391
|
});
|
|
5378
5392
|
}
|
|
5379
5393
|
}
|
|
5380
|
-
return {
|
|
5381
|
-
...packageJson,
|
|
5382
|
-
...sorted
|
|
5383
|
-
};
|
|
5394
|
+
return __spreadValues(__spreadValues({}, packageJson), sorted);
|
|
5384
5395
|
}
|
|
5385
5396
|
|
|
5386
5397
|
// utils/renderTemplate.js
|
|
@@ -5451,12 +5462,27 @@ function getCommand(packageManager, scriptName) {
|
|
|
5451
5462
|
}
|
|
5452
5463
|
|
|
5453
5464
|
// utils/generateReadme.js
|
|
5454
|
-
var sfcTypeSupportDoc =
|
|
5465
|
+
var sfcTypeSupportDoc = [
|
|
5466
|
+
"",
|
|
5467
|
+
"## Type Support for `.vue` Imports in TS",
|
|
5468
|
+
"",
|
|
5469
|
+
"TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.",
|
|
5470
|
+
"",
|
|
5471
|
+
"If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:",
|
|
5472
|
+
"",
|
|
5473
|
+
"1. Disable the built-in TypeScript Extension",
|
|
5474
|
+
" 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette",
|
|
5475
|
+
" 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`",
|
|
5476
|
+
"2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.",
|
|
5477
|
+
""
|
|
5478
|
+
].join("\n");
|
|
5455
5479
|
function generateReadme({
|
|
5456
5480
|
projectName,
|
|
5457
5481
|
packageManager,
|
|
5458
5482
|
needsTypeScript,
|
|
5459
|
-
|
|
5483
|
+
needsCypress,
|
|
5484
|
+
needsCypressCT,
|
|
5485
|
+
needsVitest,
|
|
5460
5486
|
needsEslint
|
|
5461
5487
|
}) {
|
|
5462
5488
|
let readme = `# ${projectName}
|
|
@@ -5465,7 +5491,7 @@ This template should help get you started developing with Vue 3 in Vite.
|
|
|
5465
5491
|
|
|
5466
5492
|
## Recommended IDE Setup
|
|
5467
5493
|
|
|
5468
|
-
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur).
|
|
5494
|
+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin).
|
|
5469
5495
|
${needsTypeScript ? sfcTypeSupportDoc : ""}
|
|
5470
5496
|
## Customize configuration
|
|
5471
5497
|
|
|
@@ -5490,14 +5516,26 @@ ${getCommand(packageManager, "dev")}
|
|
|
5490
5516
|
${getCommand(packageManager, "build")}
|
|
5491
5517
|
\`\`\`
|
|
5492
5518
|
`;
|
|
5493
|
-
if (
|
|
5519
|
+
if (needsVitest) {
|
|
5520
|
+
npmScriptsDescriptions += `
|
|
5521
|
+
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
|
5522
|
+
|
|
5523
|
+
\`\`\`sh
|
|
5524
|
+
${getCommand(packageManager, "test:unit")}
|
|
5525
|
+
\`\`\`
|
|
5526
|
+
`;
|
|
5527
|
+
}
|
|
5528
|
+
if (needsCypressCT) {
|
|
5494
5529
|
npmScriptsDescriptions += `
|
|
5495
5530
|
### Run Unit Tests with [Cypress Component Testing](https://docs.cypress.io/guides/component-testing/introduction)
|
|
5496
5531
|
|
|
5497
5532
|
\`\`\`sh
|
|
5498
5533
|
${getCommand(packageManager, "test:unit")} # or \`${getCommand(packageManager, "test:unit:ci")}\` for headless testing
|
|
5499
5534
|
\`\`\`
|
|
5500
|
-
|
|
5535
|
+
`;
|
|
5536
|
+
}
|
|
5537
|
+
if (needsCypress) {
|
|
5538
|
+
npmScriptsDescriptions += `
|
|
5501
5539
|
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
|
|
5502
5540
|
|
|
5503
5541
|
\`\`\`sh
|
|
@@ -5548,13 +5586,7 @@ var config = {
|
|
|
5548
5586
|
"vue/setup-compiler-macros": true
|
|
5549
5587
|
}
|
|
5550
5588
|
};
|
|
5551
|
-
|
|
5552
|
-
{
|
|
5553
|
-
files: ["**/__tests__/*.spec.{js,ts,jsx,tsx}", "cypress/integration/**.spec.{js,ts,jsx,tsx}"],
|
|
5554
|
-
extends: ["plugin:cypress/recommended"]
|
|
5555
|
-
}
|
|
5556
|
-
];
|
|
5557
|
-
function configureEslint({ language, styleGuide, needsPrettier, needsCypress }) {
|
|
5589
|
+
function configureEslint({ language, styleGuide, needsPrettier, needsCypress, needsCypressCT }) {
|
|
5558
5590
|
switch (`${styleGuide}-${language}`) {
|
|
5559
5591
|
case "default-javascript":
|
|
5560
5592
|
config.extends.push("eslint:recommended");
|
|
@@ -5571,6 +5603,12 @@ function configureEslint({ language, styleGuide, needsPrettier, needsCypress })
|
|
|
5571
5603
|
config.extends.push("@vue/eslint-config-prettier");
|
|
5572
5604
|
}
|
|
5573
5605
|
if (needsCypress) {
|
|
5606
|
+
const cypressOverrides = [
|
|
5607
|
+
{
|
|
5608
|
+
files: needsCypressCT ? ["**/__tests__/*.spec.{js,ts,jsx,tsx}", "cypress/integration/**.spec.{js,ts,jsx,tsx}"] : ["cypress/integration/**.spec.{js,ts,jsx,tsx}"],
|
|
5609
|
+
extends: ["plugin:cypress/recommended"]
|
|
5610
|
+
}
|
|
5611
|
+
];
|
|
5574
5612
|
addEslintDependency("eslint-plugin-cypress");
|
|
5575
5613
|
config.overrides = cypressOverrides;
|
|
5576
5614
|
}
|
|
@@ -5588,12 +5626,13 @@ function configureEslint({ language, styleGuide, needsPrettier, needsCypress })
|
|
|
5588
5626
|
configuration
|
|
5589
5627
|
};
|
|
5590
5628
|
}
|
|
5591
|
-
function renderEslint(rootDir, { needsTypeScript,
|
|
5629
|
+
function renderEslint(rootDir, { needsTypeScript, needsCypress, needsCypressCT, needsPrettier }) {
|
|
5592
5630
|
const { dependencies: dependencies2, configuration } = configureEslint({
|
|
5593
5631
|
language: needsTypeScript ? "typescript" : "javascript",
|
|
5594
5632
|
styleGuide: "default",
|
|
5595
5633
|
needsPrettier,
|
|
5596
|
-
needsCypress
|
|
5634
|
+
needsCypress,
|
|
5635
|
+
needsCypressCT
|
|
5597
5636
|
});
|
|
5598
5637
|
const packageJsonPath = import_path3.default.resolve(rootDir, "package.json");
|
|
5599
5638
|
const existingPkg = JSON.parse(import_fs4.default.readFileSync(packageJsonPath));
|
|
@@ -5623,6 +5662,9 @@ function canSafelyOverwrite(dir) {
|
|
|
5623
5662
|
return !import_fs5.default.existsSync(dir) || import_fs5.default.readdirSync(dir).length === 0;
|
|
5624
5663
|
}
|
|
5625
5664
|
function emptyDir(dir) {
|
|
5665
|
+
if (!import_fs5.default.existsSync(dir)) {
|
|
5666
|
+
return;
|
|
5667
|
+
}
|
|
5626
5668
|
postOrderDirectoryTraverse(dir, (dir2) => import_fs5.default.rmdirSync(dir2), (file) => import_fs5.default.unlinkSync(file));
|
|
5627
5669
|
}
|
|
5628
5670
|
async function init() {
|
|
@@ -5633,12 +5675,12 @@ ${banner_default}
|
|
|
5633
5675
|
const argv = (0, import_minimist.default)(process.argv.slice(2), {
|
|
5634
5676
|
alias: {
|
|
5635
5677
|
typescript: ["ts"],
|
|
5636
|
-
"with-tests": ["tests"
|
|
5678
|
+
"with-tests": ["tests"],
|
|
5637
5679
|
router: ["vue-router"]
|
|
5638
5680
|
},
|
|
5639
5681
|
boolean: true
|
|
5640
5682
|
});
|
|
5641
|
-
const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.pinia || argv.tests || argv.eslint) === "boolean";
|
|
5683
|
+
const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.pinia || argv.tests || argv.vitest || argv.cypress || argv.eslint) === "boolean";
|
|
5642
5684
|
let targetDir = argv._[0];
|
|
5643
5685
|
const defaultProjectName = !targetDir ? "vue-project" : targetDir;
|
|
5644
5686
|
const forceOverwrite = argv.force;
|
|
@@ -5709,9 +5751,17 @@ ${banner_default}
|
|
|
5709
5751
|
inactive: "No"
|
|
5710
5752
|
},
|
|
5711
5753
|
{
|
|
5712
|
-
name: "
|
|
5754
|
+
name: "needsVitest",
|
|
5755
|
+
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
5756
|
+
message: "Add Vitest for Unit Testing?",
|
|
5757
|
+
initial: false,
|
|
5758
|
+
active: "Yes",
|
|
5759
|
+
inactive: "No"
|
|
5760
|
+
},
|
|
5761
|
+
{
|
|
5762
|
+
name: "needsCypress",
|
|
5713
5763
|
type: () => isFeatureFlagsUsed ? null : "toggle",
|
|
5714
|
-
message: "Add Cypress for testing?",
|
|
5764
|
+
message: (prev, answers) => answers.needsVitest ? "Add Cypress for End-to-End testing?" : "Add Cypress for both Unit and End-to-End testing?",
|
|
5715
5765
|
initial: false,
|
|
5716
5766
|
active: "Yes",
|
|
5717
5767
|
inactive: "No"
|
|
@@ -5747,18 +5797,21 @@ ${banner_default}
|
|
|
5747
5797
|
process.exit(1);
|
|
5748
5798
|
}
|
|
5749
5799
|
const {
|
|
5750
|
-
|
|
5751
|
-
|
|
5800
|
+
projectName,
|
|
5801
|
+
packageName = projectName,
|
|
5802
|
+
shouldOverwrite = argv.force,
|
|
5752
5803
|
needsJsx = argv.jsx,
|
|
5753
5804
|
needsTypeScript = argv.typescript,
|
|
5754
5805
|
needsRouter = argv.router,
|
|
5755
5806
|
needsPinia = argv.pinia,
|
|
5756
|
-
|
|
5807
|
+
needsCypress = argv.cypress || argv.tests,
|
|
5808
|
+
needsVitest = argv.vitest || argv.tests,
|
|
5757
5809
|
needsEslint = argv.eslint || argv["eslint-with-prettier"],
|
|
5758
5810
|
needsPrettier = argv["eslint-with-prettier"]
|
|
5759
5811
|
} = result;
|
|
5812
|
+
const needsCypressCT = needsCypress && !needsVitest;
|
|
5760
5813
|
const root = import_path4.default.join(cwd, targetDir);
|
|
5761
|
-
if (shouldOverwrite) {
|
|
5814
|
+
if (import_fs5.default.existsSync(root) && shouldOverwrite) {
|
|
5762
5815
|
emptyDir(root);
|
|
5763
5816
|
} else if (!import_fs5.default.existsSync(root)) {
|
|
5764
5817
|
import_fs5.default.mkdirSync(root);
|
|
@@ -5782,14 +5835,20 @@ Scaffolding project in ${root}...`);
|
|
|
5782
5835
|
if (needsPinia) {
|
|
5783
5836
|
render("config/pinia");
|
|
5784
5837
|
}
|
|
5785
|
-
if (
|
|
5838
|
+
if (needsVitest) {
|
|
5839
|
+
render("config/vitest");
|
|
5840
|
+
}
|
|
5841
|
+
if (needsCypress) {
|
|
5786
5842
|
render("config/cypress");
|
|
5787
5843
|
}
|
|
5844
|
+
if (needsCypressCT) {
|
|
5845
|
+
render("config/cypress-ct");
|
|
5846
|
+
}
|
|
5788
5847
|
if (needsTypeScript) {
|
|
5789
5848
|
render("config/typescript");
|
|
5790
5849
|
}
|
|
5791
5850
|
if (needsEslint) {
|
|
5792
|
-
renderEslint(root,
|
|
5851
|
+
renderEslint(root, { needsTypeScript, needsCypress, needsCypressCT, needsPrettier });
|
|
5793
5852
|
}
|
|
5794
5853
|
const codeTemplate = (needsTypeScript ? "typescript-" : "") + (needsRouter ? "router" : "default");
|
|
5795
5854
|
render(`code/${codeTemplate}`);
|
|
@@ -5819,23 +5878,23 @@ Scaffolding project in ${root}...`);
|
|
|
5819
5878
|
const indexHtmlPath = import_path4.default.resolve(root, "index.html");
|
|
5820
5879
|
const indexHtmlContent = import_fs5.default.readFileSync(indexHtmlPath, "utf8");
|
|
5821
5880
|
import_fs5.default.writeFileSync(indexHtmlPath, indexHtmlContent.replace("src/main.js", "src/main.ts"));
|
|
5822
|
-
}
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
import_fs5.default.rmdirSync(dirpath);
|
|
5829
|
-
}
|
|
5830
|
-
}, () => {
|
|
5881
|
+
} else {
|
|
5882
|
+
preOrderDirectoryTraverse(root, () => {
|
|
5883
|
+
}, (filepath) => {
|
|
5884
|
+
if (filepath.endsWith(".ts")) {
|
|
5885
|
+
import_fs5.default.unlinkSync(filepath);
|
|
5886
|
+
}
|
|
5831
5887
|
});
|
|
5832
5888
|
}
|
|
5833
|
-
const
|
|
5889
|
+
const userAgent = process.env.npm_config_user_agent ?? "";
|
|
5890
|
+
const packageManager = /pnpm/.test(userAgent) ? "pnpm" : /yarn/.test(userAgent) ? "yarn" : "npm";
|
|
5834
5891
|
import_fs5.default.writeFileSync(import_path4.default.resolve(root, "README.md"), generateReadme({
|
|
5835
5892
|
projectName: result.projectName || defaultProjectName,
|
|
5836
5893
|
packageManager,
|
|
5837
5894
|
needsTypeScript,
|
|
5838
|
-
|
|
5895
|
+
needsVitest,
|
|
5896
|
+
needsCypress,
|
|
5897
|
+
needsCypressCT,
|
|
5839
5898
|
needsEslint
|
|
5840
5899
|
}));
|
|
5841
5900
|
console.log(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vue",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "An easy way to start a Vue project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
"esbuild": "^0.13.15",
|
|
29
29
|
"husky": "^7.0.4",
|
|
30
30
|
"kolorist": "^1.5.1",
|
|
31
|
-
"lint-staged": "^12.
|
|
31
|
+
"lint-staged": "^12.2.0",
|
|
32
32
|
"minimist": "^1.2.5",
|
|
33
33
|
"npm-run-all": "^4.1.5",
|
|
34
34
|
"prettier": "^2.5.1",
|
|
35
|
-
"prompts": "^2.4.2"
|
|
35
|
+
"prompts": "^2.4.2",
|
|
36
|
+
"zx": "^4.3.0"
|
|
36
37
|
},
|
|
37
38
|
"lint-staged": {
|
|
38
39
|
"*.{js,ts,vue,json}": [
|
|
@@ -41,10 +42,10 @@
|
|
|
41
42
|
},
|
|
42
43
|
"scripts": {
|
|
43
44
|
"format": "prettier --write .",
|
|
44
|
-
"build": "esbuild --bundle index.js --format=cjs --platform=node --outfile=outfile.cjs",
|
|
45
|
-
"snapshot": "
|
|
45
|
+
"build": "esbuild --bundle index.js --format=cjs --platform=node --target=node14 --outfile=outfile.cjs",
|
|
46
|
+
"snapshot": "zx ./scripts/snapshot.mjs",
|
|
46
47
|
"pretest": "run-s build snapshot",
|
|
47
|
-
"test": "
|
|
48
|
+
"test": "zx ./scripts/test.mjs"
|
|
48
49
|
},
|
|
49
50
|
"readme": "# create-vue\n\n[](https://open.vscode.dev/vuejs/create-vue)\n\nAn easy way to start a Vue project\n\n## Usage\n\n```sh\nnpm init vue@3\n```\n\nOr, if you need to support IE11, you can create a Vue 2 project with:\n\n```sh\nnpm init vue@2\n```\n"
|
|
50
51
|
}
|
|
@@ -6,12 +6,12 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/base/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/base/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@2.7.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/vite.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../node_modules/.pnpm/vite@2.7.
|
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/vite.js" "$@"
|
|
17
17
|
fi
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
|
|
14
14
|
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
|
|
15
|
-
--vt-c-divider-
|
|
15
|
+
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
|
|
16
16
|
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
|
|
17
17
|
|
|
18
18
|
--vt-c-text-light-1: var(--vt-c-indigo);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { RouterLink, RouterView } from 'vue-router'
|
|
2
3
|
import HelloWorld from '@/components/HelloWorld.vue'
|
|
3
4
|
</script>
|
|
4
5
|
|
|
@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
|
|
|
10
11
|
<HelloWorld msg="You did it!" />
|
|
11
12
|
|
|
12
13
|
<nav>
|
|
13
|
-
<
|
|
14
|
-
<
|
|
14
|
+
<RouterLink to="/">Home</RouterLink>
|
|
15
|
+
<RouterLink to="/about">About</RouterLink>
|
|
15
16
|
</nav>
|
|
16
17
|
</div>
|
|
17
18
|
</header>
|
|
18
19
|
|
|
19
|
-
<
|
|
20
|
+
<RouterView />
|
|
20
21
|
</template>
|
|
21
22
|
|
|
22
23
|
<style>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
|
|
14
14
|
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
|
|
15
|
-
--vt-c-divider-
|
|
15
|
+
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
|
|
16
16
|
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
|
|
17
17
|
|
|
18
18
|
--vt-c-text-light-1: var(--vt-c-indigo);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { RouterLink, RouterView } from 'vue-router'
|
|
2
3
|
import HelloWorld from '@/components/HelloWorld.vue'
|
|
3
4
|
</script>
|
|
4
5
|
|
|
@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
|
|
|
10
11
|
<HelloWorld msg="You did it!" />
|
|
11
12
|
|
|
12
13
|
<nav>
|
|
13
|
-
<
|
|
14
|
-
<
|
|
14
|
+
<RouterLink to="/">Home</RouterLink>
|
|
15
|
+
<RouterLink to="/about">About</RouterLink>
|
|
15
16
|
</nav>
|
|
16
17
|
</div>
|
|
17
18
|
</header>
|
|
18
19
|
|
|
19
|
-
<
|
|
20
|
+
<RouterView />
|
|
20
21
|
</template>
|
|
21
22
|
|
|
22
23
|
<style>
|
|
File without changes
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
// This function is called when a project is opened or re-opened (e.g. due to
|
|
14
14
|
// the project's config changing)
|
|
15
15
|
|
|
16
|
-
const { startDevServer } = require('@cypress/vite-dev-server')
|
|
17
|
-
|
|
18
16
|
/**
|
|
19
17
|
* @type {Cypress.PluginConfig}
|
|
20
18
|
*/
|
|
@@ -22,8 +20,5 @@ const { startDevServer } = require('@cypress/vite-dev-server')
|
|
|
22
20
|
module.exports = (on, config) => {
|
|
23
21
|
// `on` is used to hook into various events Cypress emits
|
|
24
22
|
// `config` is the resolved Cypress config
|
|
25
|
-
on('dev-server:start', (options) => {
|
|
26
|
-
return startDevServer({ options })
|
|
27
|
-
})
|
|
28
23
|
return config
|
|
29
24
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="cypress" />
|
|
4
|
+
// ***********************************************************
|
|
5
|
+
// This example plugins/index.ts can be used to load plugins
|
|
6
|
+
//
|
|
7
|
+
// You can change the location of this file or turn off loading
|
|
8
|
+
// the plugins file with the 'pluginsFile' configuration option.
|
|
9
|
+
//
|
|
10
|
+
// You can read more here:
|
|
11
|
+
// https://on.cypress.io/plugins-guide
|
|
12
|
+
// ***********************************************************
|
|
13
|
+
|
|
14
|
+
// This function is called when a project is opened or re-opened (e.g. due to
|
|
15
|
+
// the project's config changing)
|
|
16
|
+
|
|
17
|
+
export default ((on, config) => {
|
|
18
|
+
// `on` is used to hook into various events Cypress emits
|
|
19
|
+
// `config` is the resolved Cypress config
|
|
20
|
+
return config
|
|
21
|
+
}) as Cypress.PluginConfig
|
|
@@ -6,12 +6,12 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@9.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/cypress" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@9.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/cypress" "$@"
|
|
17
17
|
fi
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"scripts": {
|
|
3
|
-
"test:unit": "cypress open-ct",
|
|
4
|
-
"test:unit:ci": "cypress run-ct --quiet --reporter spec",
|
|
5
3
|
"test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
|
|
6
4
|
"test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'"
|
|
7
5
|
},
|
|
8
6
|
"devDependencies": {
|
|
9
|
-
"
|
|
10
|
-
"@cypress/vue": "^3.1.0",
|
|
11
|
-
"cypress": "^9.2.0",
|
|
7
|
+
"cypress": "^9.3.1",
|
|
12
8
|
"start-server-and-test": "^1.14.0"
|
|
13
9
|
}
|
|
14
10
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
/// <reference types="cypress" />
|
|
3
|
+
// ***********************************************************
|
|
4
|
+
// This example plugins/index.js can be used to load plugins
|
|
5
|
+
//
|
|
6
|
+
// You can change the location of this file or turn off loading
|
|
7
|
+
// the plugins file with the 'pluginsFile' configuration option.
|
|
8
|
+
//
|
|
9
|
+
// You can read more here:
|
|
10
|
+
// https://on.cypress.io/plugins-guide
|
|
11
|
+
// ***********************************************************
|
|
12
|
+
|
|
13
|
+
// This function is called when a project is opened or re-opened (e.g. due to
|
|
14
|
+
// the project's config changing)
|
|
15
|
+
|
|
16
|
+
const { startDevServer } = require('@cypress/vite-dev-server')
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @type {Cypress.PluginConfig}
|
|
20
|
+
*/
|
|
21
|
+
// eslint-disable-next-line no-unused-vars
|
|
22
|
+
module.exports = (on, config) => {
|
|
23
|
+
// `on` is used to hook into various events Cypress emits
|
|
24
|
+
// `config` is the resolved Cypress config
|
|
25
|
+
on('dev-server:start', (options) => {
|
|
26
|
+
return startDevServer({ options })
|
|
27
|
+
})
|
|
28
|
+
return config
|
|
29
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress-ct/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@9.3.1/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress-ct/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/cypress" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@9.3.1/node_modules/cypress/bin/cypress" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress-ct/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@2.7.13/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/cypress-ct/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/vite.js" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vite@2.7.13/node_modules/vite/bin/vite.js" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": {
|
|
3
|
+
"test:unit": "cypress open-ct",
|
|
4
|
+
"test:unit:ci": "cypress run-ct --quiet --reporter spec"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"vue": "^3.2.27"
|
|
8
|
+
},
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@cypress/vite-dev-server": "^2.2.2",
|
|
11
|
+
"@cypress/vue": "^3.1.0",
|
|
12
|
+
"cypress": "^9.3.1",
|
|
13
|
+
"vite": "^2.7.13"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/template/{code/default → config/cypress-ct}/src/components/__tests__/HelloWorld.spec.js
RENAMED
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules/vitest/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/vitest/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="$NODE_PATH:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules/vitest/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules:/Users/haoqun/Developer/vuejs/node_modules:/Users/haoqun/Developer/node_modules:/Users/haoqun/node_modules:/Users/node_modules:/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/vitest/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/config/node_modules:/Users/haoqun/Developer/vuejs/create-vue/template/node_modules"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules/vitest/vitest.mjs" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vitest@0.1.23_jsdom@19.0.0/node_modules/vitest/vitest.mjs" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import { mount } from '@vue/test-utils'
|
|
4
|
+
import HelloWorld from '../HelloWorld.vue'
|
|
5
|
+
|
|
6
|
+
describe('HelloWorld', () => {
|
|
7
|
+
it('renders properly', () => {
|
|
8
|
+
const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } })
|
|
9
|
+
expect(wrapper.text()).toContain('Hello Vitest')
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// https://docs.cypress.io/api/introduction/api.html
|
|
2
|
-
|
|
3
|
-
describe('My First Test', () => {
|
|
4
|
-
it('visits the app root url', () => {
|
|
5
|
-
cy.visit('/')
|
|
6
|
-
cy.contains('h1', 'You did it!')
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('navigates to the about page', () => {
|
|
10
|
-
cy.visit('/about')
|
|
11
|
-
cy.contains('h1', 'This is an about page')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { mount } from '@cypress/vue'
|
|
2
|
-
import HelloWorld from '../HelloWorld.vue'
|
|
3
|
-
|
|
4
|
-
describe('HelloWorld', () => {
|
|
5
|
-
it('playground', () => {
|
|
6
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('renders properly', () => {
|
|
10
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
11
|
-
cy.get('h1').should('contain', 'Hello Cypress')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { mount } from '@cypress/vue'
|
|
2
|
-
import HelloWorld from '../HelloWorld.vue'
|
|
3
|
-
|
|
4
|
-
describe('HelloWorld', () => {
|
|
5
|
-
it('playground', () => {
|
|
6
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('renders properly', () => {
|
|
10
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
11
|
-
cy.get('h1').should('contain', 'Hello Cypress')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// https://docs.cypress.io/api/introduction/api.html
|
|
2
|
-
|
|
3
|
-
describe('My First Test', () => {
|
|
4
|
-
it('visits the app root url', () => {
|
|
5
|
-
cy.visit('/')
|
|
6
|
-
cy.contains('h1', 'You did it!')
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('navigates to the about page', () => {
|
|
10
|
-
cy.visit('/about')
|
|
11
|
-
cy.contains('h1', 'This is an about page')
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { mount } from '@cypress/vue'
|
|
2
|
-
import HelloWorld from '../HelloWorld.vue'
|
|
3
|
-
|
|
4
|
-
describe('HelloWorld', () => {
|
|
5
|
-
it('playground', () => {
|
|
6
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('renders properly', () => {
|
|
10
|
-
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
|
|
11
|
-
cy.get('h1').should('contain', 'Hello Cypress')
|
|
12
|
-
})
|
|
13
|
-
})
|