Skip to content

Commit a9395fc

Browse files
committed
fix: fix lint rules
1 parent 7cbd012 commit a9395fc

File tree

13 files changed

+213
-153
lines changed

13 files changed

+213
-153
lines changed

angular.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"schematics": {},
99
"root": "",
1010
"sourceRoot": "src",
11-
"prefix": "app",
11+
"prefix": "ble",
1212
"architect": {
1313
"build": {
1414
"builder": "@angular-devkit/build-angular:browser",
@@ -169,4 +169,4 @@
169169
"cli": {
170170
"analytics": "6c503e91-213a-464d-801c-5af37e13087c"
171171
}
172-
}
172+
}

e2e/protractor.conf.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
// @ts-check
12
// Protractor configuration file, see link for more information
23
// https://github.com/angular/protractor/blob/master/lib/config.ts
34

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

7+
/**
8+
* @type { import("protractor").Config }
9+
*/
610
exports.config = {
711
allScriptsTimeout: 11000,
812
specs: [
913
'./src/**/*.e2e-spec.ts'
1014
],
1115
capabilities: {
12-
'browserName': 'chrome'
16+
browserName: 'chrome'
1317
},
1418
directConnect: true,
1519
baseUrl: 'http://localhost:4200/',
@@ -21,7 +25,7 @@ exports.config = {
2125
},
2226
onPrepare() {
2327
require('ts-node').register({
24-
project: require('path').join(__dirname, './tsconfig.e2e.json')
28+
project: require('path').join(__dirname, './tsconfig.json')
2529
});
2630
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
2731
}

e2e/src/app.e2e-spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
23

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

1011
it('should display welcome message', () => {
1112
page.navigateTo();
12-
expect(page.getParagraphText()).toEqual('Welcome to angular-web-bluetooth-starter!');
13+
expect(page.getTitleText()).toEqual('angular-web-bluetooth-starter app is running!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
1322
});
1423
});

e2e/src/app.po.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { browser, by, element } from 'protractor';
22

33
export class AppPage {
4-
navigateTo() {
5-
return browser.get('/');
4+
navigateTo(): Promise<unknown> {
5+
return browser.get(browser.baseUrl) as Promise<unknown>;
66
}
77

8-
getParagraphText() {
9-
return element(by.css('app-root h1')).getText();
8+
getTitleText(): Promise<string> {
9+
return element(by.css('app-root .content span')).getText() as Promise<string>;
1010
}
1111
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../out-tsc/app",
4+
"outDir": "../out-tsc/e2e",
55
"module": "commonjs",
66
"target": "es5",
77
"types": [
@@ -10,4 +10,4 @@
1010
"node"
1111
]
1212
}
13-
}
13+
}

0 commit comments

Comments
 (0)