-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jasmine & protractor integration tests #82
- Loading branch information
Showing
34 changed files
with
147 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loglevel = silent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
sudo: required | ||
dist: trusty | ||
addons: | ||
apt: | ||
sources: | ||
- google-chrome | ||
packages: | ||
- google-chrome-stable | ||
language: node_js | ||
node_js: | ||
- '6.5' | ||
script: | ||
- npm run coveralls | ||
- npm run coveralls && npm run test:integration | ||
before_install: | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loglevel = silent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loglevel = silent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loglevel = silent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { exec } from "child_process"; | ||
import { readFileSync } from "fs"; | ||
const JsDiff = require("diff"); | ||
|
||
// https://github.com/jasmine/jasmine-npm/issues/85 | ||
process.env.JASMINE_CONFIG_PATH = "spec/support/jasmine.json"; | ||
const TIMEOUT_INCREASED = 120000; | ||
|
||
const filter = (diff) => { | ||
const value = (element) => { | ||
return element.value; | ||
}; | ||
const added = diff.filter((element) => { | ||
return element.added === true; | ||
}).map(value); | ||
const removed = diff.filter((element) => { | ||
return element.removed === true; | ||
}).map(value); | ||
return { added, removed }; | ||
}; | ||
|
||
describe("Integration", () => { | ||
it("with jasmine-npm should be ok", (done) => { | ||
exec("cd examples/node && npm test", (error, stdout) => { | ||
const expected = readFileSync("spec/resources/node-example.out", { encoding: "utf-8" }); | ||
const { added, removed } = filter(JsDiff.diffLines(expected, stdout)); | ||
expect(added).toEqual(removed); | ||
done(); | ||
}); | ||
}, TIMEOUT_INCREASED); | ||
|
||
it("with protractor should be ok", (done) => { | ||
exec("cd examples/protractor && npm test", (error, stdout) => { | ||
const expected = readFileSync("spec/resources/node-protractor.out", { encoding: "utf-8" }); | ||
const { added, removed } = filter(JsDiff.diffLines(expected, stdout)); | ||
expect(added).toEqual(removed); | ||
done(); | ||
}); | ||
}, TIMEOUT_INCREASED); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Spec started | ||
|
||
first suite | ||
[32m✓ should be ok[39m | ||
[33m* should be pending[39m | ||
[31m✗ should failed[39m | ||
[31m- [39m[31mExpected true to be false.[39m | ||
[32m✓ should be ok[39m | ||
|
||
second suite | ||
[33m* should be pending[39m | ||
[32m✓ should be ok[39m | ||
|
||
first child suite | ||
|
||
first grandchild suite | ||
[31m✗ should failed[39m | ||
[31m- [39m[31mExpected true to be false.[39m | ||
[31m- [39m[31mExpected true to be false.[39m | ||
[31m✗ should failed[39m | ||
[31m- [39m[31mExpected true to be false.[39m | ||
[32m✓ should be ok[39m | ||
|
||
second grandchild suite | ||
[31m✗ should failed[39m | ||
[31m- [39m[31mExpected true to be false.[39m | ||
[32m✓ should be ok[39m | ||
|
||
************************************************** | ||
* Failures * | ||
************************************************** | ||
|
||
1) first suite should failed | ||
[31m- [39m[31mExpected true to be false.[39m | ||
|
||
2) second suite first child suite first grandchild suite should failed | ||
[31m- [39m[31mExpected true to be false.[39m | ||
[31m- [39m[31mExpected true to be false.[39m | ||
|
||
3) second suite first child suite first grandchild suite should failed | ||
[31m- [39m[31mExpected true to be false.[39m | ||
|
||
4) second suite first child suite second grandchild suite should failed | ||
[31m- [39m[31mExpected true to be false.[39m | ||
|
||
************************************************** | ||
* Pending * | ||
************************************************** | ||
|
||
1) first suite should be pending | ||
[33mwill work soon[39m | ||
|
||
2) second suite should be pending | ||
[33mTemporarily disabled with xit[39m | ||
|
||
Executed 9 of 11 specs[31m (4 FAILED)[39m[33m (2 PENDING)[39m. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Spec started | ||
|
||
angularjs homepage | ||
[32m✓ should greet the named user[39m | ||
|
||
Executed 1 of 1 spec[32m SUCCESS[39m. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"spec_dir": "spec", | ||
"spec_files": [ | ||
"integration/**/*.spec.js" | ||
], | ||
"helpers": [ | ||
"helpers/**/*.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
"target": "es5" | ||
}, | ||
"include": [ | ||
"./**/*.ts", | ||
"../typings/**/*.ts" | ||
"./**/*.ts" | ||
] | ||
} |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
spec/configuration-parser.spec.ts → spec/unit/configuration-parser.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.