This repository was archived by the owner on Jul 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +15
-56
lines changed Expand file tree Collapse file tree 8 files changed +15
-56
lines changed Original file line number Diff line number Diff line change 11{
2- "presets" : [" @babel/env" ],
3- "plugins" : [" @babel/plugin-proposal-class-properties" ]
2+ "presets" : [" @babel/env" ]
43}
Original file line number Diff line number Diff line change 99 - uses : actions/checkout@master
1010 - name : Prettier
1111 run : |
12- yarn global add prettier@^2.2.0
13- ~/. yarn/bin/ prettier --check src/**/*.js --config .prettierrc.json
12+ yarn add prettier@^2.2.0
13+ yarn run prettier --check { src,test} /**/*.js --config .prettierrc.json
1414
1515 tests :
1616 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 33Symfony UX Stimulus testing is a low-level package to help write tests for Stimulus controllers
44in applications and reusable packages.
55
6- ** If you are developing a project with Symfony Flex, you should probably use the ux-test-pack
7- instead** . The pack includes this package and configures it automatically in your application.
8-
96Symfony UX Stimulus testing is currently considered ** experimental** .
107
118## Installation
@@ -50,12 +47,13 @@ module.exports = {
5047{
5148 "presets" : [" @babel/env" ],
5249 "plugins" : [" @babel/plugin-proposal-class-properties" ]
50+ }
5351```
5452
55535 . Finally, create your first test, for instance ` hello_controller.test.js ` :
5654
5755``` js
58- import { Application } from 'stimulus';
56+ import { Application } from ' @hotwired/ stimulus' ;
5957import { clearDOM , mountDOM } from ' @symfony/stimulus-testing' ;
6058import HelloController from ' ../controllers/hello_controller.js' ;
6159
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22 "name" : " @symfony/stimulus-testing" ,
33 "description" : " @testing-library integration for Symfony UX" ,
44 "version" : " 1.1.0" ,
5- "main" : " dist /index.js" ,
5+ "main" : " src /index.js" ,
66 "license" : " MIT" ,
77 "author" :
" Titouan Galopin <[email protected] >" ,
88 "engines" : {
99 "node" : " ^10.13.0 || >=12.0.0"
1010 },
1111 "scripts" : {
12- "build" : " babel src -d dist" ,
13- "test" : " babel src -d dist && jest"
14- },
15- "peerDependencies" : {
16- "stimulus" : " ^2.0"
12+ "test" : " jest"
1713 },
1814 "dependencies" : {
1915 "@testing-library/dom" : " ^7.28.1" ,
2521 "regenerator-runtime" : " ^0.13.7"
2622 },
2723 "devDependencies" : {
28- "@babel/cli" : " ^7.12.1" ,
2924 "@babel/core" : " ^7.12.3" ,
30- "@babel/plugin-proposal-class-properties" : " ^7.12.1" ,
3125 "@babel/preset-env" : " ^7.12.7" ,
32- "stimulus" : " ^2 .0.0"
26+ "@hotwired/ stimulus" : " ^3 .0.0"
3327 },
3428 "jest" : {
3529 "testRegex" : " test/.*\\ .test.js" ,
3933 },
4034 "files" : [
4135 " src/" ,
42- " dist/" ,
4336 " setup.js"
4437 ]
4538}
Original file line number Diff line number Diff line change 1- require ( './dist /setup.js' ) ;
1+ require ( './src /setup.js' ) ;
Original file line number Diff line number Diff line change 66 * For the full copyright and license information, please view the LICENSE
77 * file that was distributed with this source code.
88 */
9- 'use strict' ;
10-
11- require ( "mutationobserver-shim" ) ;
129
13- require ( "regenerator-runtime/runtime.js" ) ;
10+ 'use strict' ;
1411
15- require ( "@testing-library/jest-dom" ) ;
12+ require ( 'mutationobserver-shim' ) ;
13+ require ( 'regenerator-runtime/runtime.js' ) ;
14+ require ( '@testing-library/jest-dom' ) ;
Original file line number Diff line number Diff line change 99
1010'use strict' ;
1111
12- import { Application , Controller } from 'stimulus' ;
12+ import { Application , Controller } from '@hotwired/ stimulus' ;
1313import { getByTestId , waitFor } from '@testing-library/dom' ;
14- import { clearDOM , mountDOM } from '../dist /index' ;
14+ import { clearDOM , mountDOM } from '../src /index' ;
1515
1616// Controller used to check the actual controller was properly booted
1717class AppController extends Controller {
You can’t perform that action at this time.
0 commit comments