Skip to content

Commit

Permalink
Debugging failing tests on Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMessinger committed Jul 8, 2020
1 parent 5912fbf commit 38e757f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI-CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
matrix:
os:
- ubuntu-latest # Chrome, Firefox, Safari (via SauceLabs), Edge (via SauceLabs)
# - windows-latest # Internet Explorer
- windows-latest # Internet Explorer

steps:
- name: Checkout source
Expand Down
11 changes: 6 additions & 5 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

"use strict";
const { karmaConfig } = require("@jsdevtools/karma-config");
const { host } = require("@jsdevtools/host-environment");

module.exports = karmaConfig({
sourceDir: "esm",
fixtures: "test/fixtures/**/*.js",
browsers: {
chrome: false,
firefox: false,
safari: true,
edge: false,
ie: false,
chrome: host.ci ? host.os.linux : true,
firefox: host.ci ? host.os.linux : true,
safari: host.ci ? host.os.linux : host.os.mac, // SauceLabs in CI
edge: host.ci ? host.os.linux : host.os.windows, // SauceLabs in CI
ie: host.ci ? host.os.windows : false, // IE needs to run by itself, due to Babel transforms
},
});
2 changes: 1 addition & 1 deletion test/specs/ono-extend.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { compareKeys, comparePOJO, compareStacks, host } = require("../utils");
// https://nodejs.org/api/util.html#util_util_inspect_custom
const inspect = Symbol.for("nodejs.util.inspect.custom");

describe.skip("Ono.extend()", () => {
describe("Ono.extend()", () => {

it("should enhance an error object with Ono functionality", () => {
function createRangeError () {
Expand Down
16 changes: 8 additions & 8 deletions test/utils/compare-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,43 @@ function compareKeys (...expected) {
* @returns {boolean}
*/
return function (error) {
let actual = [];
let actual = new Set();

// Make sure all the specified keys exist
for (let key of expected) {
if (key in error) {
actual.push(key);
actual.add(key);
}
}

// Make sure the error doesn't have any extra keys
// eslint-disable-next-line guard-for-in
for (let key in error) {
if (!actual.includes(key)) {
actual.push(key);
}
actual.add(key);
}

if (host.error.hasColumn && "column" in error) {
console.log("column exists");
actual.add("column");
expected.push("column");
}

if (host.error.hasLine && "line" in error) {
console.log("line exists");
actual.add("line");
expected.push("line");
}

if (host.error.hasSourceURL && "sourceURL" in error) {
console.log("sourceURL exists");
actual.add("sourceURL");
expected.push("sourceURL");
}

if (host.error.hasEnumerableDescription && "description" in error) {
actual.add("description");
expected.push("description");
}

try {
actual = [...actual];
expect(actual).to.have.same.members(expected);
}
catch (e) {
Expand Down

0 comments on commit 38e757f

Please sign in to comment.