Skip to content

Commit

Permalink
fix: fix lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
manekinekko committed Mar 29, 2020
1 parent 7cbd012 commit a9395fc
Show file tree
Hide file tree
Showing 13 changed files with 213 additions and 153 deletions.
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"prefix": "ble",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
Expand Down Expand Up @@ -169,4 +169,4 @@
"cli": {
"analytics": "6c503e91-213a-464d-801c-5af37e13087c"
}
}
}
8 changes: 6 additions & 2 deletions e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
Expand All @@ -21,7 +25,7 @@ exports.config = {
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
Expand Down
11 changes: 10 additions & 1 deletion e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';

describe('workspace-project App', () => {
let page: AppPage;
Expand All @@ -9,6 +10,14 @@ describe('workspace-project App', () => {

it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to angular-web-bluetooth-starter!');
expect(page.getTitleText()).toEqual('angular-web-bluetooth-starter app is running!');
});

afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
8 changes: 4 additions & 4 deletions e2e/src/app.po.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get('/');
navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl) as Promise<unknown>;
}

getParagraphText() {
return element(by.css('app-root h1')).getText();
getTitleText(): Promise<string> {
return element(by.css('app-root .content span')).getText() as Promise<string>;
}
}
4 changes: 2 additions & 2 deletions e2e/tsconfig.e2e.json → e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
Expand All @@ -10,4 +10,4 @@
"node"
]
}
}
}
Loading

0 comments on commit a9395fc

Please sign in to comment.