* [test] update danger version and danger file import

Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3f0ddca0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3f0ddca0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3f0ddca0

Branch: refs/heads/master
Commit: 3f0ddca09b410f0547bc534f7e2ac12be8609cb1
Parents: 9172cdd
Author: gurisxie <279483...@qq.com>
Authored: Fri Sep 22 13:45:20 2017 +0800
Committer: gurisxie <279483...@qq.com>
Committed: Fri Sep 22 13:45:20 2017 +0800

----------------------------------------------------------------------
 .travis.yml           | 9 ++++++++-
 dangerfile-android.js | 2 +-
 dangerfile-ios.js     | 2 +-
 dangerfile-jsfm.js    | 2 +-
 dangerfile.js         | 2 +-
 package.json          | 2 +-
 6 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3f0ddca0/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 8a49ae6..a7bca6f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -49,11 +49,18 @@ before_script:
       nvm install 7.0
       npm install
     fi
+  - |
+    if [[ $TEST_SUITE = "jsfm" ]]; then
+      npm install
+    fi
+  - |
+    if [[ $TEST_SUITE = "danger" ]]; then
+      npm install
+    fi
 script:
   - |
     if [[ $TEST_SUITE = "android" ]]; then
       npm run danger -- run --dangerfile ./dangerfile-android.js
-      cd $TRAVIS_BUILD_DIR
     fi
   - |
     if [[ $TEST_SUITE = "jsfm" ]]; then

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3f0ddca0/dangerfile-android.js
----------------------------------------------------------------------
diff --git a/dangerfile-android.js b/dangerfile-android.js
index 2e81f0a..f10dd94 100644
--- a/dangerfile-android.js
+++ b/dangerfile-android.js
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-// Removed import
+import { schedule, danger, fail, warn, message, markdown } from "danger";
 import fs from "fs";
 import path from 'path';
 import GitHubApi from 'github';

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3f0ddca0/dangerfile-ios.js
----------------------------------------------------------------------
diff --git a/dangerfile-ios.js b/dangerfile-ios.js
index 079e516..007d830 100644
--- a/dangerfile-ios.js
+++ b/dangerfile-ios.js
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-// Removed import
+import { schedule, danger, fail, warn, message, markdown } from "danger";
 import fs from "fs";
 import path from 'path';
 import GitHubApi from 'github';

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3f0ddca0/dangerfile-jsfm.js
----------------------------------------------------------------------
diff --git a/dangerfile-jsfm.js b/dangerfile-jsfm.js
index 64b72f4..71d6402 100644
--- a/dangerfile-jsfm.js
+++ b/dangerfile-jsfm.js
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-// Removed import
+import { schedule, danger, fail, warn, message, markdown } from "danger";
 import fs from "fs";
 import path from 'path';
 import GitHubApi from 'github';

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3f0ddca0/dangerfile.js
----------------------------------------------------------------------
diff --git a/dangerfile.js b/dangerfile.js
index 05db91d..2a7829f 100644
--- a/dangerfile.js
+++ b/dangerfile.js
@@ -305,7 +305,7 @@ function findReviewer(resolve, reject) {
     owner: danger.github.pr.base.user.login,
     repo: repoName,
     number: danger.github.pr.number,
-    headers: {Accept: 'application/vnd.github.diff'}
+    headers: {Accept: 'application/vnd.github.diff',"user-agent": "node.js"}
   }, function (err, result) {
     console.log('parseDeleteAndNormalLines')
     if ("undefined" === typeof result || "undefined" === typeof result.data || 
err) {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3f0ddca0/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 87f5429..828d9af 100644
--- a/package.json
+++ b/package.json
@@ -122,7 +122,7 @@
     "chromedriver": "^2.21.2",
     "cross-spawn": "^4.0.0",
     "css-loader": "^0.26.1",
-    "danger": "^1.2.0",
+    "danger": "^0.18.0",
     "dateformat": "^2.0.0",
     "eslint": "^2.11.1",
     "eslint-plugin-flowtype": "^2.30.4",

Reply via email to