@@ -22,25 +22,17 @@ All examples in these documents will assume `testdouble` is available as `td`.
22
22
23
23
### For use in Browsers
24
24
25
- The most recent release (not master itself) is always available on the master
26
- branch of the git repo, to make it easier to fetch the browser distribution of
27
- testdouble.js
25
+ When we publish new versions of testdouble.js, we also generate a browser build
26
+ of the library that's ready to be used in browsers, which you'll find in
27
+ "dist/testdouble.js" of the installed package. This distribution will also
28
+ define a ` td ` global variable, so you can use the library without necessitating
29
+ any kind of module system in your test build.
28
30
29
- #### curl
31
+ #### via npm
30
32
31
- The easiest way to fetch testdouble is to curl it:
32
-
33
- ```
34
- $ curl https://raw.githubusercontent.com/testdouble/testdouble.js/master/dist/testdouble.js -o test/helpers/testdouble.js
35
- ```
36
-
37
- And then just check it into source control. It may be old-fashioned, but it
38
- still works.
39
-
40
- #### npm
41
-
42
- You can also install testdouble from npm and then copy, move, symlink, or point
43
- your front-end build tool at it:
33
+ Most people manage their front-end dependencies these days with ` npm ` , so most
34
+ commonly we'd expect people to pull down testdouble.js by installing it with npm
35
+ and pointing whatever front-end build tool they use to it.
44
36
45
37
```
46
38
$ npm install --save-dev testdouble
@@ -49,11 +41,17 @@ $ npm install --save-dev testdouble
49
41
And then find the browser distribution of the library in
50
42
` node_modules/testdouble/dist/testdouble.js ` .
51
43
44
+ #### via unpkg
52
45
46
+ You can also just fetch the latest (or any) version of the library from
47
+ the unpkg CDN. You can even curl it:
53
48
54
49
```
50
+ $ curl -L https://unpkg.com/testdouble/dist/testdouble.js
55
51
```
56
52
53
+ And then just check it into source control. It may be old-fashioned, but it
54
+ still works.
57
55
58
56
## Configuring testdouble.js Setting up in your test suite
59
57
0 commit comments