Skip to content

Fixes #1986 - Start migration to Intern 4 #1987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 16, 2018
Merged
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
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ branches:
language: python

addons:
firefox: 55.0
firefox: latest
chrome: stable

python:
- "2.7"
Expand Down Expand Up @@ -53,4 +54,4 @@ before_script:
# now run the tests!
script:
- nosetests
- node_modules/.bin/intern-runner config=tests/intern reporters=Console
- node ./tests/functional/_intern.js reporters="runner"
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"node": ">= 4.x"
},
"dependencies": {
"amd-to-commonjs-codemod": "^1.2.0",
"cssrecipes-custom-media-queries": "0.3.0",
"cssrecipes-defaults": "^0.5.0",
"cssrecipes-grid": "^1.0.0",
Expand All @@ -37,7 +38,7 @@
"grunt-contrib-watch": "^1.0.0",
"grunt-postcss": "^0.8.0",
"husky": "^0.13.4",
"intern": "^3.4.6",
"intern": "^4.1.4",
"lint-staged": "^3.6.1",
"load-grunt-tasks": "^3.5.2",
"postcss": "^5.2.17",
Expand Down Expand Up @@ -70,7 +71,7 @@
"project-update": "pip install --upgrade pip && npm update",
"precommit": "lint-staged",
"test": "npm run test:js && npm run test:python",
"test:js": "node_modules/.bin/intern-runner config=tests/intern",
"test:js": "node ./tests/functional/_intern.js",
"test:python": "nosetests"
},
"lint-staged": {
Expand Down
9 changes: 9 additions & 0 deletions tests/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"globals": {
"intern": true,
"process": true
},
"rules": {
"no-console": "off"
}
}
38 changes: 0 additions & 38 deletions tests/functional-all.js

This file was deleted.

29 changes: 0 additions & 29 deletions tests/functional-nonauth.js

This file was deleted.

68 changes: 68 additions & 0 deletions tests/functional/_intern.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* This Source Code Form is subject to the terms of the Mozilla Public

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

const intern = require("intern").default;

const args = {};
process.argv.forEach((val, index) => {
if (val.indexOf("=") !== -1) {
args[val.split("=")[0]] = val.split("=")[1];
} else {
args[index] = val;
}
});

const siteRoot = args.siteRoot ? args.siteRoot : "http://localhost:5000";

let environments = [];
const browsers = args.browsers
? args.browsers.replace(/\s/g, "").split(",")
: ["firefox", "chrome"];

browsers.forEach(function(b) {
environments.push({
browserName: b.toLowerCase(),
marionette: true
});
});

intern.configure({
// Configuration object for webcompat
wc: {
pageLoadTimeout: args.wcPageLoadTimeout
? parseInt(args.wcPageLoadTimeout, 10)
: 10000
},

plugins: "./tests/functional/lib/setup.js",

maxConcurrency: 1,

// The port on which the instrumenting proxy will listen
proxyPort: 9090,

// A fully qualified URL to the Intern proxy
proxyUrl: "http://127.0.0.1:9090/",
siteRoot: siteRoot,
tunnel: "selenium",
tunnelOptions: {
// this tells SeleniumTunnel to download geckodriver and chromedriver
drivers: ["firefox", "chrome"]
},

environments: environments,

filterErrorStack: true,
reporters: [args.reporters ? args.reporters : "pretty"],

functionalSuites: ["./tests/functional/*.js"]
});

intern.run().catch(e => {
// This might not throw, BUG filed: https://github.com/theintern/intern/issues/868
console.log(e);
process.exit(1);
});
Loading