You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2016/11/30 17:31:52 UTC

[1/2] fauxton commit: updated refs/heads/master to ae5070b

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 14224ea7e -> ae5070b43


tests: port helperSpec to jest

our first jest based tests :)

PR: #815
PR-URL: https://github.com/apache/couchdb-fauxton/pull/815
Reviewed-By: garren smith <ga...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/ae5070b4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/ae5070b4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/ae5070b4

Branch: refs/heads/master
Commit: ae5070b4338d05d15e30688f7b6bbc94bab20327
Parents: de6f434
Author: Robert Kowalski <ro...@apache.org>
Authored: Tue Nov 29 18:31:05 2016 +0100
Committer: Robert Kowalski <ro...@apache.org>
Committed: Wed Nov 30 18:31:37 2016 +0100

----------------------------------------------------------------------
 .../replication/__tests__/helpers-tests.js      | 34 ++++++++++++++++
 app/addons/replication/tests/helpersSpec.js     | 41 --------------------
 2 files changed, 34 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/ae5070b4/app/addons/replication/__tests__/helpers-tests.js
----------------------------------------------------------------------
diff --git a/app/addons/replication/__tests__/helpers-tests.js b/app/addons/replication/__tests__/helpers-tests.js
new file mode 100644
index 0000000..0703f39
--- /dev/null
+++ b/app/addons/replication/__tests__/helpers-tests.js
@@ -0,0 +1,34 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+import helpers from '../helpers';
+
+describe('Replication Helpers - getDatabaseLabel', () => {
+
+  it('returns database name for string', () => {
+    const db = 'http://tester:testerpass@127.0.0.1/fancy/db/name';
+
+    const res = helpers.getDatabaseLabel(db);
+
+    expect(res).toBe('fancy/db/name');
+  });
+
+  it('returns database name for object', () => {
+    const db = {
+      url: 'http://tester:testerpass@127.0.0.1/fancy'
+    };
+
+    const res = helpers.getDatabaseLabel(db);
+    expect(res).toBe('fancy');
+  });
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/ae5070b4/app/addons/replication/tests/helpersSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/replication/tests/helpersSpec.js b/app/addons/replication/tests/helpersSpec.js
deleted file mode 100644
index 5e2b1c3..0000000
--- a/app/addons/replication/tests/helpersSpec.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-import utils from "../../../../test/mocha/testUtils";
-import helpers from '../helpers';
-const assert = utils.assert;
-
-describe('Replication Helpers', () => {
-
-  describe('getDatabaseLabel', () => {
-
-    it('returns database name for string', () => {
-      const db = 'http://tester:testerpass@127.0.0.1/fancy/db/name';
-
-      const dbName = helpers.getDatabaseLabel(db);
-      assert.deepEqual('fancy/db/name', dbName);
-
-    });
-
-    it('returns database name for object', () => {
-      const db = {
-        url: 'http://tester:testerpass@127.0.0.1/fancy'
-      };
-
-      const dbName = helpers.getDatabaseLabel(db);
-      assert.deepEqual('fancy', dbName);
-
-    });
-
-  });
-
-});


[2/2] fauxton commit: updated refs/heads/master to ae5070b

Posted by ro...@apache.org.
tests: add jest for testing

Adds Jest for testing. Right now it runs in parallel to our
old test setup.

The idea is that we can use the faster, simpler testing for all
new stuff and all refactored elements.

To run jest, simply run:

`npm run jest`

PR: #815
PR-URL: https://github.com/apache/couchdb-fauxton/pull/815
Reviewed-By: garren smith <ga...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/de6f4341
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/de6f4341
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/de6f4341

Branch: refs/heads/master
Commit: de6f43413b6db9e62ffd8746ca9a7333ceddd2f2
Parents: 14224ea
Author: Robert Kowalski <ro...@apache.org>
Authored: Tue Nov 29 18:30:01 2016 +0100
Committer: Robert Kowalski <ro...@apache.org>
Committed: Wed Nov 30 18:31:37 2016 +0100

----------------------------------------------------------------------
 jest-config.json | 3 +++
 package.json     | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/de6f4341/jest-config.json
----------------------------------------------------------------------
diff --git a/jest-config.json b/jest-config.json
new file mode 100644
index 0000000..3321768
--- /dev/null
+++ b/jest-config.json
@@ -0,0 +1,3 @@
+{
+  "testPathDirs": ["app"]
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/de6f4341/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 8f05189..09ed104 100644
--- a/package.json
+++ b/package.json
@@ -18,6 +18,7 @@
   "devDependencies": {
     "enzyme": "^2.4.1",
     "es5-shim": "4.5.4",
+    "jest": "^17.0.3",
     "mocha": "~3.1.2",
     "mocha-loader": "^1.0.0",
     "mocha-phantomjs": "git+https://github.com/garrensmith/mocha-phantomjs.git",
@@ -103,7 +104,8 @@
     "webpack:dev": "webpack --debug --progress --colors --config ./webpack.config.dev.js",
     "webpack:test": "webpack --debug --progress --colors --config ./webpack.config.test.js",
     "webpack:release": "webpack --debug --progress --colors --config ./webpack.config.release.js",
-    "test": "grunt test",
+    "jest": "jest --config ./jest-config.json",
+    "test": "npm run jest && grunt test",
     "phantomjs": "./node_modules/.bin/mocha-phantomjs --debug=false --ssl-protocol=sslv2 --web-security=false --ignore-ssl-errors=true ./test/runner.html",
     "couchdebug": "grunt couchdebug",
     "couchdb": "grunt couchdb",