feat: git hook config (husky eslint prettier)
This commit is contained in:
@@ -16,22 +16,23 @@
|
||||
"settings": {
|
||||
"import/resolver": {
|
||||
"node": {
|
||||
"extensions": [
|
||||
".js",
|
||||
".jsx",
|
||||
".ts",
|
||||
".tsx"
|
||||
]
|
||||
"extensions": [".js", ".jsx", ".ts", ".tsx"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"ignorePatterns": ["**/dist/**/*", "**/.dist/**/*"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unused-vars": ["error", {
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"argsIgnorePattern": "^_"
|
||||
}],
|
||||
"@typescript-eslint/no-explicit-any": ["error", {
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": [
|
||||
"error",
|
||||
{
|
||||
"ignoreRestArgs": true
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_;
|
||||
30
.husky/_/husky.sh
Normal file
30
.husky/_/husky.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
if [ -z "$husky_skip_init" ]; then
|
||||
debug () {
|
||||
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
|
||||
}
|
||||
|
||||
readonly hook_name="$(basename "$0")"
|
||||
debug "starting $hook_name..."
|
||||
|
||||
if [ "$HUSKY" = "0" ]; then
|
||||
debug "HUSKY env variable is set to 0, skipping hook"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f ~/.huskyrc ]; then
|
||||
debug "sourcing ~/.huskyrc"
|
||||
. ~/.huskyrc
|
||||
fi
|
||||
|
||||
export readonly husky_skip_init=1
|
||||
sh -e "$0" "$@"
|
||||
exitCode="$?"
|
||||
|
||||
if [ $exitCode != 0 ]; then
|
||||
echo "husky - $hook_name hook exited with code $exitCode (error)"
|
||||
exit $exitCode
|
||||
fi
|
||||
|
||||
exit 0
|
||||
fi
|
||||
4
.husky/commit-msg
Executable file
4
.husky/commit-msg
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install commitlint --edit "$1"
|
||||
5
.husky/pre-commit
Executable file
5
.husky/pre-commit
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
||||
npx pretty-quick --staged
|
||||
8
.prettierrc
Normal file
8
.prettierrc
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"useTabs": true,
|
||||
"tabSize": 2,
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "es5",
|
||||
"bracketSpacing": true
|
||||
}
|
||||
983
package-lock.json
generated
983
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -45,8 +45,10 @@
|
||||
"publish": "electron-forge publish",
|
||||
"lint": "eslint --ext .ts .",
|
||||
"test:electron-e2e": "npm run package && cross-env X_NODE_ENV=e2e-test node workspaces/electron-e2e/jasmine.js",
|
||||
"clean": "del -f .webpack out node_modules workspaces/shared-lib/.dist workspaces/angular-app/node_modules workspaces/angular-app/.dist",
|
||||
"version": "npx conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md"
|
||||
"clean": "shx rm -rf .webpack out node_modules workspaces/shared-lib/.dist workspaces/angular-app/node_modules workspaces/angular-app/.dist",
|
||||
"version": "npx conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
|
||||
"prepare": "husky install",
|
||||
"postinstall": "husky install && shx rm -rf .git/hooks && shx ln -s ../.husky .git/hooks"
|
||||
},
|
||||
"config": {
|
||||
"forge": {
|
||||
@@ -121,18 +123,22 @@
|
||||
"copy-webpack-plugin": "^9.0.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^5.0.0",
|
||||
"del-cli": "^4.0.1",
|
||||
"electron": "^13.1.7",
|
||||
"eslint": "^7.6.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.20.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"fork-ts-checker-webpack-plugin": "^6.0.1",
|
||||
"husky": "^7.0.1",
|
||||
"jasmine": "^3.8.0",
|
||||
"jasmine-core": "^3.8.0",
|
||||
"jasmine-spec-reporter": "^7.0.0",
|
||||
"lint-staged": "^11.0.1",
|
||||
"node-loader": "^2.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"npm-watch": "^0.10.0",
|
||||
"prettier": "^2.3.2",
|
||||
"shx": "^0.3.3",
|
||||
"spectron": "^15.0.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"ts-loader": "^9.2.2",
|
||||
@@ -145,9 +151,7 @@
|
||||
"fs-extra": "^10.0.0",
|
||||
"winston": "^3.3.3"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
||||
}
|
||||
"lint-staged": {
|
||||
"*.ts": "npm run lint"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,5 @@
|
||||
"*": ["node_modules/*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"workspaces/electron-app/**/*",
|
||||
"workspaces/electron-e2e/**/*"
|
||||
]
|
||||
"include": ["workspaces/electron-app/**/*", "workspaces/electron-e2e/**/*"]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const path = require("path");
|
||||
const path = require('path');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
@@ -13,17 +13,17 @@ module.exports = {
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
|
||||
modules: [path.resolve(__dirname, "node_modules"), "node_modules"]
|
||||
modules: [path.resolve(__dirname, 'node_modules'), 'node_modules'],
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{ from: "workspaces/electron-app/main/assets" },
|
||||
{ from: 'workspaces/electron-app/main/assets' },
|
||||
{
|
||||
from: "workspaces/angular-app/.dist/angular-app",
|
||||
to: "../renderer/angular_window",
|
||||
noErrorOnMissing: true
|
||||
}
|
||||
from: 'workspaces/angular-app/.dist/angular-app',
|
||||
to: '../renderer/angular_window',
|
||||
noErrorOnMissing: true,
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Editor configuration, see https://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.ts]
|
||||
quote_type = single
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
@@ -26,13 +26,8 @@
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "tsconfig.app.json",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.scss"
|
||||
],
|
||||
"assets": ["src/favicon.ico", "src/assets"],
|
||||
"styles": ["src/styles.scss"],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
@@ -94,13 +89,8 @@
|
||||
"tsConfig": "tsconfig.spec.json",
|
||||
"karmaConfig": "karma.conf.js",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.scss"
|
||||
],
|
||||
"assets": ["src/favicon.ico", "src/assets"],
|
||||
"styles": ["src/styles.scss"],
|
||||
"scripts": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,7 @@
|
||||
"importHelpers": true,
|
||||
"target": "es2017",
|
||||
"module": "es2020",
|
||||
"lib": [
|
||||
"es2018",
|
||||
"dom"
|
||||
]
|
||||
"lib": ["es2018", "dom"]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"enableI18nLegacyMessageIdFormat": false,
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { app, BrowserWindow, shell } from "electron";
|
||||
import { Window } from "./window";
|
||||
import { app, BrowserWindow, shell } from 'electron';
|
||||
import { Window } from './window';
|
||||
|
||||
export class App {
|
||||
private static _wrapper: Window;
|
||||
|
||||
public static launch(): void {
|
||||
app.on("window-all-closed", App.quit);
|
||||
app.on("activate", App.start);
|
||||
app.on("ready", App.start);
|
||||
app.on('window-all-closed', App.quit);
|
||||
app.on('activate', App.start);
|
||||
app.on('ready', App.start);
|
||||
|
||||
// Fix warning by applying electron new default value for this property
|
||||
// Further details : https://github.com/electron/electron/issues/18397
|
||||
app.allowRendererProcessReuse = true;
|
||||
|
||||
// Limit navigation and open external links in default browser
|
||||
app.on("web-contents-created", App.openExternalLinksInDefaultBrowser);
|
||||
app.on('web-contents-created', App.openExternalLinksInDefaultBrowser);
|
||||
}
|
||||
|
||||
public static get electronWindow(): BrowserWindow | undefined {
|
||||
@@ -30,7 +30,7 @@ export class App {
|
||||
|
||||
private static quit() {
|
||||
// On MacOS it is common for applications to stay open until the user explicitly quits
|
||||
if (process.platform !== "darwin") {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
@@ -45,16 +45,16 @@ export class App {
|
||||
shell.openExternal(handler.url);
|
||||
|
||||
// Blocking this event from loading in current app
|
||||
return { action: "deny" };
|
||||
return { action: 'deny' };
|
||||
});
|
||||
|
||||
// Limiting navigation
|
||||
contents.on(
|
||||
"will-navigate",
|
||||
'will-navigate',
|
||||
(event: Electron.Event, navigationUrl: string) => {
|
||||
const parsedUrl = new URL(navigationUrl);
|
||||
// Allowing local navigation only
|
||||
if (parsedUrl.origin !== "http://localhost:4200") {
|
||||
if (parsedUrl.origin !== 'http://localhost:4200') {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { app, BrowserWindow, ipcMain, nativeImage } from "electron";
|
||||
import * as path from "path";
|
||||
import { AbstractService } from "../services/abstract-service";
|
||||
import { MultiplesService } from "../services/multiples-service";
|
||||
import { Logger } from "../utils/logger";
|
||||
import { app, BrowserWindow, ipcMain, nativeImage } from 'electron';
|
||||
import * as path from 'path';
|
||||
import { AbstractService } from '../services/abstract-service';
|
||||
import { MultiplesService } from '../services/multiples-service';
|
||||
import { Logger } from '../utils/logger';
|
||||
|
||||
declare const global: Global;
|
||||
declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: string;
|
||||
@@ -20,7 +20,7 @@ export class Window {
|
||||
this._electronWindow = new BrowserWindow({
|
||||
width: 1280,
|
||||
height: 720,
|
||||
backgroundColor: "#FFFFFF",
|
||||
backgroundColor: '#FFFFFF',
|
||||
// FIXME
|
||||
// icon: this.loadIcon(),
|
||||
webPreferences: {
|
||||
@@ -46,11 +46,11 @@ export class Window {
|
||||
private loadIcon(): Electron.NativeImage | undefined {
|
||||
let iconObj = undefined;
|
||||
if (global.appConfig.isIconAvailable) {
|
||||
const iconPath = path.join(__dirname, "icons/icon.png");
|
||||
Logger.debug("Icon Path", iconPath);
|
||||
const iconPath = path.join(__dirname, 'icons/icon.png');
|
||||
Logger.debug('Icon Path', iconPath);
|
||||
iconObj = nativeImage.createFromPath(iconPath);
|
||||
// Change dock icon on MacOS
|
||||
if (iconObj && process.platform === "darwin") {
|
||||
if (iconObj && process.platform === 'darwin') {
|
||||
app.dock.setIcon(iconObj);
|
||||
}
|
||||
}
|
||||
@@ -58,14 +58,14 @@ export class Window {
|
||||
}
|
||||
|
||||
private loadRenderer(): void {
|
||||
if (global.appConfig.configId === "development") {
|
||||
if (global.appConfig.configId === 'development') {
|
||||
// Dev mode, take advantage of the live reload by loading local URL
|
||||
this.electronWindow.loadURL(`http://localhost:4200`);
|
||||
} else {
|
||||
// Else mode, we simply load angular bundle
|
||||
const indexPath = path.join(
|
||||
__dirname,
|
||||
"../renderer/angular_window/index.html"
|
||||
'../renderer/angular_window/index.html'
|
||||
);
|
||||
this.electronWindow.loadURL(`file://${indexPath}`);
|
||||
}
|
||||
@@ -75,7 +75,7 @@ export class Window {
|
||||
}
|
||||
|
||||
// When the window is closed`
|
||||
this._electronWindow.on("closed", () => {
|
||||
this._electronWindow.on('closed', () => {
|
||||
// Remove IPC Main listeners
|
||||
ipcMain.removeAllListeners();
|
||||
// Delete current reference
|
||||
@@ -85,7 +85,7 @@ export class Window {
|
||||
|
||||
private openDevTools(): void {
|
||||
this._electronWindow.webContents.openDevTools();
|
||||
this._electronWindow.webContents.on("devtools-opened", () => {
|
||||
this._electronWindow.webContents.on('devtools-opened', () => {
|
||||
this._electronWindow.focus();
|
||||
setImmediate(() => {
|
||||
this._electronWindow.focus();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as fs from "fs-extra";
|
||||
import * as _ from "lodash";
|
||||
import * as path from "path";
|
||||
import { AppConfig } from "shared-lib";
|
||||
import { App } from "./components/app";
|
||||
import * as fs from 'fs-extra';
|
||||
import * as _ from 'lodash';
|
||||
import * as path from 'path';
|
||||
import { AppConfig } from 'shared-lib';
|
||||
import { App } from './components/app';
|
||||
|
||||
declare const global: Global;
|
||||
|
||||
@@ -15,11 +15,11 @@ declare global {
|
||||
|
||||
// Load config
|
||||
const currentEnv = process.env.X_NODE_ENV || process.env.NODE_ENV;
|
||||
const appConfigs = fs.readJsonSync(path.join(__dirname, "config.json"));
|
||||
const appConfigs = fs.readJsonSync(path.join(__dirname, 'config.json'));
|
||||
const defaultConf = appConfigs.development;
|
||||
const currentConf = appConfigs[currentEnv];
|
||||
global.appConfig =
|
||||
currentEnv === "development"
|
||||
currentEnv === 'development'
|
||||
? defaultConf
|
||||
: _.merge(defaultConf, currentConf);
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
export class AbstractService<In, Out> {
|
||||
receptionChannel(): string {
|
||||
throw new Error("Method not implemented yet.");
|
||||
throw new Error('Method not implemented yet.');
|
||||
}
|
||||
|
||||
sendingChannel(): string {
|
||||
throw new Error("Method not implemented yet.");
|
||||
throw new Error('Method not implemented yet.');
|
||||
}
|
||||
|
||||
process(_input: In): Out {
|
||||
throw new Error("Method not implemented yet.");
|
||||
throw new Error('Method not implemented yet.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { WindowApiConst } from "shared-lib";
|
||||
import { AbstractService } from "./abstract-service";
|
||||
import { WindowApiConst } from 'shared-lib';
|
||||
import { AbstractService } from './abstract-service';
|
||||
|
||||
export class MultiplesService extends AbstractService<number, number[]> {
|
||||
receptionChannel(): string {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { app } from "electron";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import * as winston from "winston";
|
||||
import { app } from 'electron';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as winston from 'winston';
|
||||
|
||||
declare const global: Global;
|
||||
|
||||
@@ -52,9 +52,9 @@ export class Logger {
|
||||
|
||||
private constructor() {
|
||||
this._logger = winston.createLogger({
|
||||
level: "debug",
|
||||
level: 'debug',
|
||||
format: winston.format.json(),
|
||||
defaultMeta: { service: "user-service" },
|
||||
defaultMeta: { service: 'user-service' },
|
||||
transports: [
|
||||
new winston.transports.File({
|
||||
filename: this.getLogFilename(),
|
||||
@@ -69,10 +69,10 @@ export class Logger {
|
||||
|
||||
// If we're not in production then log also to the `console` with the format:
|
||||
// `${info.timestamp} ${info.level}: ${info.message} JSON.stringify({ ...rest }) `
|
||||
if (global.appConfig.configId === "development") {
|
||||
if (global.appConfig.configId === 'development') {
|
||||
this._logger.add(
|
||||
new winston.transports.Console({
|
||||
stderrLevels: ["error", "warn"],
|
||||
stderrLevels: ['error', 'warn'],
|
||||
format: winston.format.combine(
|
||||
winston.format.timestamp(),
|
||||
this.consoleFormat
|
||||
@@ -88,13 +88,13 @@ export class Logger {
|
||||
*/
|
||||
private getLogFilename() {
|
||||
let filename = global.appConfig.mainLogFile;
|
||||
if (global.appConfig.configId === "production") {
|
||||
if (global.appConfig.configId === 'production') {
|
||||
const appName = app.getName();
|
||||
if (process.platform == "linux") {
|
||||
if (process.platform == 'linux') {
|
||||
filename = `.config/${appName}/${filename}`;
|
||||
} else if (process.platform == "darwin") {
|
||||
} else if (process.platform == 'darwin') {
|
||||
filename = `Library/Logs/${appName}/${filename}`;
|
||||
} else if (process.platform == "win32") {
|
||||
} else if (process.platform == 'win32') {
|
||||
filename = `AppData\\Roaming\\${appName}\\${filename}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// To secure user platform when running renderer process stuff,
|
||||
// Node.JS and Electron APIs are only available in this script
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent } from "electron";
|
||||
import { WindowApi, WindowApiConst } from "shared-lib";
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
|
||||
import { WindowApi, WindowApiConst } from 'shared-lib';
|
||||
|
||||
// So we expose protected methods that allow the renderer process
|
||||
// to use the ipcRenderer without exposing the entire object
|
||||
@@ -22,14 +22,14 @@ const windowApi: WindowApi = {
|
||||
};
|
||||
|
||||
declare const window: Window;
|
||||
if (process.env.X_NODE_ENV === "e2e-test") {
|
||||
if (process.env.X_NODE_ENV === 'e2e-test') {
|
||||
// Injecting windowApi directly
|
||||
window.api = windowApi;
|
||||
} else {
|
||||
// ContextBridge API can only be used when contextIsolation is enabled
|
||||
// which is normally the case except in e2e test mode
|
||||
contextBridge.exposeInMainWorld("api", windowApi);
|
||||
contextBridge.exposeInMainWorld('api', windowApi);
|
||||
}
|
||||
|
||||
console.log(typeof window);
|
||||
console.log("The preload script has been injected successfully.");
|
||||
console.log('The preload script has been injected successfully.');
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
const Jasmine = require("jasmine");
|
||||
const { SpecReporter } = require("jasmine-spec-reporter");
|
||||
const Jasmine = require('jasmine');
|
||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||
|
||||
const jasmine = new Jasmine();
|
||||
jasmine.loadConfig({
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 15000,
|
||||
spec_dir: "workspaces/electron-e2e",
|
||||
spec_files: ["./**/*-spec.ts"],
|
||||
helpers: ["./**/*-helper.ts"],
|
||||
spec_dir: 'workspaces/electron-e2e',
|
||||
spec_files: ['./**/*-spec.ts'],
|
||||
helpers: ['./**/*-helper.ts'],
|
||||
random: false,
|
||||
seed: undefined,
|
||||
stopSpecOnExpectationFailure: false,
|
||||
});
|
||||
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
|
||||
require("ts-node").register({
|
||||
project: require("path").join(__dirname, "./tsconfig.json"),
|
||||
require('ts-node').register({
|
||||
project: require('path').join(__dirname, './tsconfig.json'),
|
||||
});
|
||||
jasmine.env.clearReporters();
|
||||
jasmine.addReporter(new SpecReporter({ spec: { displayStacktrace: 'pretty' } }));
|
||||
jasmine.addReporter(
|
||||
new SpecReporter({ spec: { displayStacktrace: 'pretty' } })
|
||||
);
|
||||
jasmine.execute();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import * as path from "path";
|
||||
import { Application } from "spectron";
|
||||
import * as path from 'path';
|
||||
import { Application } from 'spectron';
|
||||
|
||||
describe("A simple test to verify a visible window is opened with a title", () => {
|
||||
describe('A simple test to verify a visible window is opened with a title', () => {
|
||||
// Init local app
|
||||
const app = new Application({
|
||||
path: path.join(__dirname, "../../../node_modules/.bin/electron"),
|
||||
args: [path.join(__dirname, "../../../.webpack/main/index.js")],
|
||||
path: path.join(__dirname, '../../../node_modules/.bin/electron'),
|
||||
args: [path.join(__dirname, '../../../.webpack/main/index.js')],
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -22,14 +22,14 @@ describe("A simple test to verify a visible window is opened with a title", () =
|
||||
}
|
||||
});
|
||||
|
||||
it("shows an initial window", async () => {
|
||||
it('shows an initial window', async () => {
|
||||
// Checking there is one visible window
|
||||
expect(await app.browserWindow.isVisible()).toEqual(true);
|
||||
// Please note that getWindowCount() will return 2 if `dev tools` are opened.
|
||||
expect(await app.client.getWindowCount()).toEqual(1);
|
||||
});
|
||||
|
||||
it("should have expected title", async () => {
|
||||
expect(await app.client.getTitle()).toEqual("ElectronAngularQuickStart");
|
||||
it('should have expected title', async () => {
|
||||
expect(await app.client.getTitle()).toEqual('ElectronAngularQuickStart');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { WindowApi } from "./apis/window-api";
|
||||
export * from "./apis/window-api";
|
||||
export * from "./apis/window-api-consts";
|
||||
export * from "./models/config/app-config";
|
||||
import { WindowApi } from './apis/window-api';
|
||||
export * from './apis/window-api';
|
||||
export * from './apis/window-api-consts';
|
||||
export * from './models/config/app-config';
|
||||
|
||||
declare global {
|
||||
// Global augmentation of the `Window` interface
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"name": "shared-lib",
|
||||
"version": "2.0.0",
|
||||
"main": ".dist/index.js",
|
||||
"scripts": {
|
||||
},
|
||||
"scripts": {},
|
||||
"author": "Sourcygen",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user