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

Upgrade to jasmine 3.1.0 #4809

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 69 additions & 37 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,72 @@
machine:
node:
version: 6.9.1
environment:
# Fix issue with selenium-server in containers.
# See http://github.com/SeleniumHQ/docker-selenium/issues/87
DBUS_SESSION_BUS_ADDRESS: /dev/null

dependencies:
override:
- npm i
cache_directories:
- testapp/node_modules
post:
- ./node_modules/.bin/gulp lint
- ./node_modules/.bin/webdriver-manager update
- ./node_modules/.bin/webdriver-manager start:
background: true
- cd testapp && npm i
- npm start:
version: 2
jobs:
build:
docker:
- image: circleci/node:6.14-browsers
environment:
# Fix issue with selenium-server in containers.
# See http://github.com/SeleniumHQ/docker-selenium/issues/87
DBUS_SESSION_BUS_ADDRESS: /dev/null
steps:
- checkout

- run:
name: Install Dependencies
command: |
sudo apt-get update
sudo apt-get install python-pip tcpdump

# Have to update firefox, default is ESR.
sudo pip install --upgrade pip
sudo pip install mozdownload mozinstall
mozdownload --version latest --destination firefox.tar.bz2
mozinstall firefox.tar.bz2
sudo cp -R firefox/* /opt/firefox/

# Latest chrome is already installed in the default container.
# curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# sudo dpkg -i google-chrome.deb
# sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
# rm google-chrome.deb

- restore_cache:
key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}

- run:
name: NPM Install
command: |
npm i
cd testapp && npm i

- save_cache:
key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
- "node_modules"
- "testapp/node_modules"

- run:
name: Lint
command: ./node_modules/.bin/gulp lint

- run:
name: Selenium Start
background: true
- sudo apt-get update
# Install the latest Firefox beta
- pip install --upgrade pip
- pip install mozdownload mozinstall
- mozdownload --version latest --destination firefox.tar.bz2
- mozinstall firefox.tar.bz2
- sudo cp -R firefox/* /opt/firefox/
# Install the latest Chrome
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb
- sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome
- rm google-chrome.deb
# Extra tcp logging for BlockingProxy
- sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap:
command: |
./node_modules/.bin/webdriver-manager update
./node_modules/.bin/webdriver-manager start

- run:
name: TestApp Start
background: true
command: |
npm start

# Seems like the new circleci container no longer permits packet introspection on lo, even for root.
# - run:
# name: Extra tcp logging for BlockingProxy
# background: true
# command: sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap

test:
override:
- npm test
- run:
name: Test
command: npm test
10 changes: 4 additions & 6 deletions lib/frameworks/jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,11 @@ exports.run = function(runner, specs) {
};

// Run specs in semi-random order
if (jasmineNodeOpts.random) {
jasmine.getEnv().randomizeTests(true);
jasmine.getEnv().randomizeTests(jasmineNodeOpts.random);

// Sets the randomization seed if randomization is turned on
if (jasmineNodeOpts.seed) {
jasmine.getEnv().seed(jasmineNodeOpts.seed);
}
// Sets the randomization seed if randomization is turned on
if (jasmineNodeOpts.seed) {
jasmine.getEnv().seed(jasmineNodeOpts.seed);
}

return runner.runTestPreparer().then(function() {
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"blocking-proxy": "^1.0.0",
"chalk": "^1.1.3",
"glob": "^7.0.3",
"jasmine": "2.8.0",
"jasmine": "3.1.0",
"jasminewd2": "^2.1.0",
"optimist": "~0.6.0",
"q": "1.4.1",
Expand All @@ -31,7 +31,7 @@
"devDependencies": {
"@types/chalk": "^0.4.28",
"@types/glob": "^5.0.29",
"@types/jasmine": "^2.5.47",
"@types/jasmine": "^2.8.7",
"@types/jasminewd2": "^2.0.0",
"@types/minimatch": "^2.0.28",
"@types/minimist": "^1.1.28",
Expand Down
4 changes: 2 additions & 2 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ executor.addCommandlineTest('node built/cli.js spec/errorTest/slowHttpAndTimeout
.expectExitCode(1)
.expectErrors([
{message: 'The following tasks were pending[\\s\\S]*\\$http: slowcall'},
{message: 'The following tasks were pending[\\s\\S]*' +
'\\$timeout: function \\(\\) {[\\s\\S]*' +
{message: 'The following tasks were pending:[\\s\\S]*' +
'- \\$timeout: function\\(\\) {[\\s\\S]*' +
'\\$scope\\.slowAngularTimeoutStatus = \'done\';[\\s\\S]' +
'*}'}
]);
Expand Down
2 changes: 1 addition & 1 deletion spec/errorTest/slowHttpAndTimeoutConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ exports.config = {

baseUrl: env.baseUrl + '/ng1/',

allScriptsTimeout: 10000
allScriptsTimeout: 4000 // Each test waits on something that has a 5 second tick.
};
3 changes: 1 addition & 2 deletions spec/unit/driverProviders/local_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('local connect', function() {
});

describe('with the selenium standalone jar', function() {
it('should throw an error if the jar file does not work', function() {
describe('should throw an error if the jar file does not work', function() {
var jarFile = '';
beforeEach(function() {
// add files to selenium folder
Expand All @@ -65,7 +65,6 @@ describe('local connect', function() {
webdriver.getNewDriver();
} catch(e) {
errorFound = true;
expect(e.code).toBe(BrowserError.CODE);
}
expect(errorFound).toBe(true);
});
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/runner_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ describe('the Protractor runner', function() {
var runner = new Runner(config);
runner.run().then(function() {
done.fail('expected error when no custom framework is defined');
}, done);
}, function() { return done(); });
});
});