Skip to content

Commit

Permalink
Fix unit tests and re-enable fail on error for tests (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
bingenito authored Feb 13, 2019
1 parent d3921fe commit 446bf3b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gulp/tasks/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function (gulp, config) {
.pipe(istanbul.hookRequire())
.on('finish', function () {
gulp.src(config.test.src)
.pipe(jasmine({ verbose: true, errorOnFail: false, includeStackTrace: false }))
.pipe(jasmine({ verbose: true, errorOnFail: true, includeStackTrace: false }))
.pipe(istanbul.writeReports({
dir: config.test.coverage.dest,
reporters: ['json']
Expand Down
2 changes: 1 addition & 1 deletion packages/desktopjs-electron/tests/electron.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ describe("ElectronGlobalShortcutManager", () => {

beforeEach(() => {
electron = { globalShortcut: jasmine.createSpyObj("Electron", ["register", "unregister", "isRegistered", "unregisterAll"]) };
container = new ElectronContainer(electron);
container = new ElectronContainer(electron, new MockIpc());
});

it ("register", () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/desktopjs-openfin/tests/openfin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MockDesktop {
}
}
}
GlobalHotkey: any;
GlobalHotkey: any = { };
Window: any = MockWindow;
Notification(): any { return {}; }
InterApplicationBus: any = new MockInterApplicationBus();
Expand Down Expand Up @@ -508,7 +508,7 @@ describe("OpenFinContainer", () => {
let app;

beforeEach(() => {
desktop = jasmine.createSpyObj("desktop", ["Application", "InterApplicationBus"]);
desktop = jasmine.createSpyObj("desktop", ["Application", "InterApplicationBus", "GlobalHotkey"]);
app = jasmine.createSpyObj("application", ["getCurrent", "registerUser", "addEventListener"]);
Object.defineProperty(desktop, "Application", { value: app });
Object.defineProperty(desktop, "InterApplicationBus", { value: new MockInterApplicationBus() });
Expand Down Expand Up @@ -819,7 +819,7 @@ describe("OpenFinDisplayManager", () => {
let system;

beforeEach(() => {
desktop = jasmine.createSpyObj("desktop", ["Application", "System", "InterApplicationBus"]);
desktop = jasmine.createSpyObj("desktop", ["Application", "System", "InterApplicationBus", "GlobalHotkey"]);
app = jasmine.createSpyObj("application", ["getCurrent", "addEventListener"]);
system = jasmine.createSpyObj("system", ["getMonitorInfo", "getMousePosition"]);
Object.defineProperty(desktop, "Application", { value: app });
Expand Down Expand Up @@ -900,8 +900,8 @@ describe("OpenfinGlobalShortcutManager", () => {

it ("Unavailable in OpenFin is unavailable on container", () => {
delete desktop.GlobalHotkey;
const container = new OpenFinContainer(desktop);
spyOn(console, "warn").and.stub();
const container = new OpenFinContainer(desktop);
expect(container.globalShortcut).toBeUndefined();
expect(console.warn).toHaveBeenCalledWith("Global shortcuts require minimum OpenFin runtime of 9.61.32.34");
});
Expand Down

0 comments on commit 446bf3b

Please sign in to comment.