create-rspeedy 0.14.1 → 0.14.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # create-rspeedy
2
2
 
3
+ ## 0.14.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Add Rstest ReactLynx Testing Library template. ([#2328](https://github.com/lynx-family/lynx-stack/pull/2328))
8
+
3
9
  ## 0.14.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -61,7 +61,7 @@ create({
61
61
  extraTools: [
62
62
  {
63
63
  value: 'vitest-rltl',
64
- label: 'ReactLynx Testing Library - unit testing',
64
+ label: 'Vitest',
65
65
  order: 'pre',
66
66
  when: (templateName)=>'react-js' === templateName || 'react-ts' === templateName,
67
67
  action: ({ distFolder, addAgentsMdSearchDirs })=>{
@@ -73,6 +73,21 @@ create({
73
73
  });
74
74
  addAgentsMdSearchDirs(from);
75
75
  }
76
+ },
77
+ {
78
+ value: 'rstest-rltl',
79
+ label: 'Rstest',
80
+ order: 'pre',
81
+ when: (templateName)=>'react-js' === templateName || 'react-ts' === templateName,
82
+ action: ({ distFolder, addAgentsMdSearchDirs })=>{
83
+ const from = node_path.resolve(src_dirname, '..', 'template-react-rstest-rltl');
84
+ copyFolder({
85
+ from,
86
+ to: distFolder,
87
+ isMergePackageJson: true
88
+ });
89
+ addAgentsMdSearchDirs(from);
90
+ }
76
91
  }
77
92
  ],
78
93
  extraSkills: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rspeedy",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "description": "Create Rspeedy-powered ReactLynx apps with one command",
5
5
  "keywords": [
6
6
  "webpack",
@@ -35,10 +35,11 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@rsbuild/plugin-type-check": "1.3.4",
38
+ "@rstest/core": "0.8.1",
38
39
  "@lynx-js/qrcode-rsbuild-plugin": "^0.4.6",
39
- "@lynx-js/react": "^0.118.0",
40
- "@lynx-js/react-rsbuild-plugin": "^0.15.0",
41
- "@lynx-js/rspeedy": "^0.14.1"
40
+ "@lynx-js/react": "^0.119.0",
41
+ "@lynx-js/react-rsbuild-plugin": "^0.16.0",
42
+ "@lynx-js/rspeedy": "^0.14.2"
42
43
  },
43
44
  "engines": {
44
45
  "node": ">=18"
@@ -0,0 +1,10 @@
1
+ {
2
+ "scripts": {
3
+ "test": "rstest run"
4
+ },
5
+ "devDependencies": {
6
+ "@rstest/core": "^0.8.1",
7
+ "@testing-library/jest-dom": "^6.9.1",
8
+ "jsdom": "^27.4.0"
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from '@rstest/core'
2
+ import { withLynxConfig } from '@lynx-js/react/testing-library/rstest-config'
3
+
4
+ export default defineConfig({
5
+ extends: withLynxConfig(),
6
+ })
@@ -0,0 +1,17 @@
1
+ // Copyright 2024 The Lynx Authors. All rights reserved.
2
+ // Licensed under the Apache License Version 2.0 that can be found in the
3
+ // LICENSE file in the root directory of this source tree.
4
+ import '@testing-library/jest-dom'
5
+ import { expect, test } from '@rstest/core'
6
+ import { getQueriesForElement, render } from '@lynx-js/react/testing-library'
7
+
8
+ import { App } from '../App'
9
+
10
+ test('App', async () => {
11
+ render(<App />)
12
+
13
+ const { findByText } = getQueriesForElement(elementTree.root)
14
+ const element = await findByText('Tap the logo and have fun!')
15
+
16
+ expect(element).toBeInTheDocument()
17
+ })
@@ -1,9 +1,9 @@
1
- import { defineConfig, mergeConfig } from 'vitest/config'
2
- import { createVitestConfig } from '@lynx-js/react/testing-library/vitest-config'
1
+ import { defineConfig } from 'vitest/config'
2
+ import { vitestTestingLibraryPlugin } from '@lynx-js/react/testing-library/plugins'
3
3
 
4
- const defaultConfig = await createVitestConfig()
5
- const config = defineConfig({
4
+ export default defineConfig({
5
+ plugins: [
6
+ vitestTestingLibraryPlugin(),
7
+ ],
6
8
  test: {},
7
9
  })
8
-
9
- export default mergeConfig(defaultConfig, config)