feat: git hook config (husky eslint prettier)

This commit is contained in:
Amadou Ada DIENE
2021-07-20 10:51:46 +02:00
parent 1a5a76f912
commit 77b15bdfc4
33 changed files with 52217 additions and 51866 deletions

View File

@@ -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"],
random: false,
seed: undefined,
stopSpecOnExpectationFailure: false,
showColors: true,
defaultTimeoutInterval: 15000,
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();

View File

@@ -1,35 +1,35 @@
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", () => {
// Init local app
const app = new Application({
path: path.join(__dirname, "../../../node_modules/.bin/electron"),
args: [path.join(__dirname, "../../../.webpack/main/index.js")],
});
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')],
});
beforeAll(async () => {
// Init local app and wait until window loaded
await app.start();
await app.client.waitUntilWindowLoaded();
});
beforeAll(async () => {
// Init local app and wait until window loaded
await app.start();
await app.client.waitUntilWindowLoaded();
});
afterAll(async () => {
if (app && app.isRunning()) {
// Wait 1 second and then stop local app
await new Promise((resolve) => setTimeout(resolve, 1000));
await app.stop();
}
});
afterAll(async () => {
if (app && app.isRunning()) {
// Wait 1 second and then stop local app
await new Promise((resolve) => setTimeout(resolve, 1000));
await app.stop();
}
});
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('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');
});
});

View File

@@ -1,10 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./.dist",
"module": "commonjs",
"target": "es5",
"noEmit": true,
"types": ["jasmine", "jasminewd2", "node"]
}
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./.dist",
"module": "commonjs",
"target": "es5",
"noEmit": true,
"types": ["jasmine", "jasminewd2", "node"]
}
}