@@ -14,90 +14,44 @@ This module allows you to run Jasmine specs for your Node.js code. The output wi
14
14
15
15
## Documentation
16
16
17
- https://jasmine.github.io/edge/node.html
17
+ https://jasmine.github.io/setup/nodejs.html
18
+
19
+ ## Quick Start
20
+
21
+ Installation:
18
22
19
- ## Installation
20
23
``` sh
21
- # Local installation:
22
24
npm install --save-dev jasmine
23
-
24
- # Global installation
25
- npm install -g jasmine
26
25
```
27
26
28
- ## Initializing
29
-
30
- To initialize a project for Jasmine
31
-
32
- ` jasmine init `
33
-
34
- To initialize a project for Jasmine when being installed locally
35
-
36
- ` node_modules/.bin/jasmine init `
37
-
38
- or
27
+ To initialize a project for Jasmine:
39
28
40
- ` npx jasmine init `
41
-
42
- To seed your project with some examples
43
-
44
- ` jasmine examples `
45
-
46
- ## Usage
47
-
48
- To run your test suite
49
-
50
- ` jasmine `
29
+ ``` sh
30
+ npx jasmine init
31
+ ````
51
32
52
- ## Configuration
33
+ To seed your project with some examples:
53
34
54
- Customize ` spec/support/jasmine.json ` to enumerate the source and spec files you would like the Jasmine runner to include.
55
- You may use dir glob strings.
56
- More information on the format of ` jasmine.json ` can be found in [ the documentation ] ( http://jasmine.github.io/edge/node.html#section-Configuration )
35
+ ` ` ` sh
36
+ npx jasmine examples
37
+ ` ` ` `
57
38
58
- Alternatively, you may specify the path to your ` jasmine.json ` by setting an environment variable or an option :
39
+ To run your test suite :
59
40
60
- ``` shell
61
- jasmine JASMINE_CONFIG_PATH=relative/path/to/your/jasmine.json
62
- jasmine --config=relative/path/to/your/jasmine.json
63
- ```
41
+ ` ` ` sh
42
+ npx jasmine
43
+ ````
64
44
65
45
# # ES and CommonJS module compatibility
66
46
67
- By default, Jasmine uses ` import ` to load spec files and helper files. This
68
- should work for both ES modules and CommonJS modules. No additional
69
- configuration is required. If you need some files to be loaded via ` require ` ,
70
- add ` "jsLoader": "require" ` to ` jasmine.json ` . With that set, Jasmine will use
71
- ` require ` to load all files with names that don't end in ` .mjs ` .
72
-
73
-
74
- # Filtering specs
75
-
76
- Execute only those specs which filename match given glob:
77
-
78
- ``` shell
79
- jasmine " spec/**/critical/*Spec.js"
80
- ```
81
-
82
- Or a single file:
83
-
84
- ``` shell
85
- jasmine spec/currentSpec.js
86
- ```
47
+ Jasmine is compatible with both ES modules and CommonJS modules. See the
48
+ [setup guide](https://jasmine.github.io/setup/nodejs.html) for more information.
87
49
88
- Or execute only those specs which name matches a particular regex:
89
-
90
- ``` shell
91
- jasmine --filter " adapter21*"
92
- ```
93
-
94
- (where the * name* of a spec is the first parameter passed to ` describe() ` )
95
50
96
51
# # Node version compatibility
97
52
98
53
Jasmine supports Node 12.x where x > =17, Node 14, and Node 16.
99
54
100
-
101
55
# # Support
102
56
103
57
Documentation: [jasmine.github.io](https://jasmine.github.io)
0 commit comments