Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit ebd348c

Browse files
JiaLiPassionmhevery
authored andcommitted
feat(build): use yarn instead of npm (#1025)
1 parent 40b110d commit ebd348c

4 files changed

Lines changed: 5987 additions & 10930 deletions

File tree

.travis.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
language: node_js
22
sudo: false
3+
dist: trusty
4+
cache: yarn
35
node_js:
4-
- '6.3.1'
6+
- 6
57
env:
68
global:
79
- BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
@@ -16,29 +18,31 @@ env:
1618
# (password is in Valentine)
1719
- TSD_GITHUB_TOKEN=ef474500309daea53d5991b3079159a29520a40b
1820

21+
before_install:
22+
- npm install -g yarn
1923
before_script:
2024
- mkdir -p $LOGS_DIR
2125
- ./scripts/sauce/sauce_connect_setup.sh
2226
- ./scripts/sauce/sauce_connect_block.sh
2327

2428
script:
25-
- npm run tslint
29+
- yarn tslint
2630
- node_modules/.bin/gulp lint
2731
- node_modules/.bin/gulp format:enforce
2832
- node_modules/.bin/gulp build
2933
- node_modules/.bin/gulp filesize
3034
- scripts/closure/closure_compiler.sh
3135
- node_modules/.bin/gulp promisetest
32-
- npm run promisefinallytest
33-
- npm run test:phantomjs-single
36+
- yarn promisefinallytest
37+
- yarn test:phantomjs-single
3438
- node_modules/.bin/karma start karma-dist-sauce-jasmine.conf.js --single-run
3539
- node_modules/.bin/karma start karma-build-sauce-mocha.conf.js --single-run
3640
- node_modules/.bin/karma start karma-dist-sauce-selenium3-jasmine.conf.js --single-run
3741
- node_modules/.bin/karma start karma-build-sauce-selenium3-mocha.conf.js --single-run
3842
- node_modules/.bin/gulp test/node
3943
- node simple-server.js 2>&1> server.log&
4044
- node ./test/webdriver/test.sauce.js
41-
42-
- npm run test:phantomjs-single
45+
46+
- yarn test:phantomjs-single
4347
- node_modules/.bin/karma start karma-dist-sauce-jasmine3.conf.js --single-run
4448
- node_modules/.bin/gulp test/node

DEVELOPER.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ To run tests
1010

1111
Make sure your environment is set up with:
1212

13-
`npm install`
13+
`yarn`
1414

1515
In a separate process, run the WebSockets server:
1616

17-
`npm run ws-server`
17+
`yarn ws-server`
1818

1919
Run the browser tests using Karma:
2020

21-
`npm test`
21+
`yarn test`
2222

2323
Run the node.js tests:
2424

25-
`npm run test-node`
25+
`yarn test-node`
2626

2727
Run tslint:
2828

29-
`npm run lint`
29+
`yarn lint`
3030

3131
Run format with clang-format:
3232

33-
`npm run format`
33+
`yarn format`
3434

3535
Run all checks (lint/format/browser test/test-node):
3636

37-
`npm run ci`
37+
`yarn ci`
3838

3939
Before Commit
4040
------------
@@ -44,12 +44,12 @@ Please make sure you pass all following checks before commit
4444
- gulp lint (tslint)
4545
- gulp format:enforce (clang-format)
4646
- gulp promisetest (promise a+ test)
47-
- npm test (karma browser test)
47+
- yarn test (karma browser test)
4848
- gulp test-node (node test)
4949

5050
You can run
5151

52-
`npm run ci`
52+
`yarn ci`
5353

5454
to do all those checks for you.
5555
You can also add the script into your git pre-commit hook
@@ -67,9 +67,9 @@ Webdriver Test
6767
1. run locally
6868

6969
```
70-
npm run webdriver-start
71-
npm run webdriver-http
72-
npm run webdriver-test
70+
yarn webdriver-start
71+
yarn webdriver-http
72+
yarn webdriver-test
7373
```
7474

7575
2. run locally with sauce connect
@@ -80,6 +80,6 @@ export SAUCE_USERNAME=XXXX
8080
export SAUCE_ACCESS_KEY=XXX
8181
8282
sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY
83-
npm run webdriver-http
84-
npm run webdriver-sauce-test
83+
yarn webdriver-http
84+
yarn webdriver-sauce-test
8585
```

0 commit comments

Comments
 (0)