Skip to content

Commit c50bbce

Browse files
committedSep 26, 2019
fix readme - add repo + homepage in package.json
1 parent cb3ce9f commit c50bbce

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed
 

‎README.md

+23
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,29 @@ Assuming here also your configuration is defined in your `package.json`, add the
7575
}
7676
```
7777

78+
## Loading the environment using annotation
79+
80+
If you are running all your tests with JSDom as main environment, you can load the Browserstack environment for a specific file by adding a Jest annotation at the beginning of your file.
81+
82+
Here is an example:
83+
84+
my-visual-test.spec.js:
85+
86+
```javascript
87+
/**
88+
* @jest-environment browserstack
89+
*/
90+
import { until, By } from 'selenium-webdriver';
91+
92+
describe('my visual test', () => {
93+
it('test something', () => {
94+
global.__driver__.get('https://mysuperurl.ltd')
95+
// do something
96+
// do test
97+
});
98+
});
99+
```
100+
78101
## Credentials
79102

80103
If you aren't willing to put your credentials in your `package.json` file, you can export in your environment `BROWSERSTACK_USER_NAME` and `BROWSERSTACK_ACCESS_KEY`. If you do so, `userName` and `accessKey` can be omitted.

‎package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"name": "jest-environment-browserstack",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "an environment for using Browserstack with Jest",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
7+
"homepage": "https://github.com/taktakpeops/jest-environment-browserstack#readme",
8+
"repository": {
9+
"type": "git",
10+
"url": "git+https://github.com/taktakpeops/jest-environment-browserstack.git"
11+
},
712
"scripts": {
813
"build": "tsc",
914
"lint": "eslint --ext .ts src/*",

0 commit comments

Comments
 (0)
Please sign in to comment.