File tree 1 file changed +45
-0
lines changed
1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,51 @@ Contributions welcome!
60
60
61
61
See [ CONTRIBUTING.md] ( https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/CONTRIBUTING.md )
62
62
63
+ ### Running the tests
64
+
65
+ 1 . ` git clone [email protected] :GoogleCloudPlatform/nodejs-docs-samples.git `
66
+ 1 . ` cd nodejs-docs-samples `
67
+ 1 . ` npm install `
68
+ 1 . Start Redis
69
+ 1 . Start Memcached
70
+ 1 . Set the ` TEST_PROJECT_ID ` environment variable to id of your project
71
+ 1 . ` npm test `
72
+
73
+ Since the tests use [ Mocha.js] ( https://mochajs.org/ ) , you can use the ` --grep `
74
+ option to run only the tests that match a provided pattern. The ` --invert `
75
+ option causes the matched tests to be excluded instead of included.
76
+
77
+ __ Run only the tests that match a pattern:__
78
+
79
+
80
+ ```
81
+ npm test -- -- --grep <pattern>
82
+ ```
83
+
84
+ __ Only run the tests for the ` datastore ` sample:__
85
+
86
+ ```
87
+ npm test -- -- --grep datastore
88
+ ```
89
+
90
+ __ Skip the tests that match a pattern:__
91
+
92
+ ```
93
+ npm test -- -- --grep <pattern> --invert
94
+ ```
95
+
96
+ __ Run all but the ` datastore ` tests:__
97
+
98
+ ```
99
+ npm test -- -- --grep datastore --invert
100
+ ```
101
+
102
+ __ Skip the tests that require Redis and Memcached:__
103
+
104
+ ```
105
+ npm test -- -- --grep "express-memcached-session|redis" --invert
106
+ ```
107
+
63
108
## Licensing
64
109
65
110
Apache Version 2.0
You can’t perform that action at this time.
0 commit comments