Skip to content

Commit b09f9b3

Browse files
committed
Working on refactor release test class
1 parent b29b9f9 commit b09f9b3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { AppComponent } from "./app.component";
66
import { ItemsComponent } from "./item/items.component";
77
import { ItemDetailComponent } from "./item/item-detail.component";
88
import { LoginComponent } from './login/login.component';
9-
import { ReleaseService } from "./Services/release.service";
9+
import { ReleaseService } from "./services/release.service";
1010

1111
// Uncomment and add to NgModule imports if you need to use two-way binding
1212
// import { NativeScriptFormsModule } from "nativescript-angular/forms";

src/tests/release.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ReleaseService } from "../app/services/release.service";
33
describe('Release notes: ', function () {
44
var releaseService: ReleaseService = new ReleaseService();
55
var data: string;
6+
var dataUpperCase: string;
67
var isReleaseFileExist: boolean;
78

89
it("Release notes is exist.", function () {
@@ -12,7 +13,8 @@ describe('Release notes: ', function () {
1213

1314
it("Read most recent release notes.", function () {
1415
if (!!isReleaseFileExist) {
15-
data = releaseService.readReleaseFile()
16+
data = releaseService.readReleaseFile();
17+
dataUpperCase = data.toUpperCase();
1618
expect(data).not.equal(null);
1719
expect(data).not.equal(undefined);
1820
expect(data).not.equal("");
@@ -56,17 +58,17 @@ describe('Release notes: ', function () {
5658

5759
it("Not Include IOS keyword.", function () {
5860
if (!!data) {
59-
expect(data.toUpperCase()).not.contain("IOS");
60-
expect(data.toUpperCase()).not.contain("APPLE");
61+
expect(dataUpperCase).not.contain("IOS");
62+
expect(dataUpperCase).not.contain("APPLE");
6163
}
6264
});
6365
});
6466

6567
describe('(IOS Platform)', function () {
6668
it("Not Include android keyword.", function () {
6769
if (!!data) {
68-
expect(data.toUpperCase()).not.contain("ANDROID");
69-
expect(data.toUpperCase()).not.contain("GOOGLE");
70+
expect(dataUpperCase).not.contain("ANDROID");
71+
expect(dataUpperCase).not.contain("GOOGLE");
7072
}
7173
});
7274
});

0 commit comments

Comments
 (0)