forked from samrum/OnStarJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Keys + Update Test Layout (samrum#15)
* Update secret key and client id * Use .env for test credential config * Add .env files to .gitignore * Add .env example file * Update test layout and make functional test a proper test * Bump version to 2.0.8
- Loading branch information
Showing
15 changed files
with
65 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DEVICEID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" | ||
VIN="1G2ZF58B774109863" | ||
USERNAME="[email protected]" | ||
PASSWORD="p@ssw0rd" | ||
ONSTARPIN="1234" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ dist | |
coverage | ||
.rpt2_cache | ||
testCredentials.json | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import dotenv from "dotenv"; | ||
dotenv.config(); | ||
import OnStar from "../../src/index"; | ||
|
||
jest.setTimeout(15000); | ||
|
||
let onStar: OnStar; | ||
|
||
describe("OnStarJs", () => { | ||
beforeAll(() => { | ||
onStar = OnStar.create({ | ||
deviceId: process.env.DEVICEID || "", | ||
vin: process.env.VIN || "", | ||
username: process.env.USERNAME || "", | ||
password: process.env.PASSWORD || "", | ||
onStarPin: process.env.ONSTARPIN || "", | ||
checkRequestStatus: false, | ||
}); | ||
}); | ||
|
||
test("Account Info", async () => { | ||
const result = await onStar.getAccountVehicles(); | ||
|
||
expect(result.status).toEqual("success"); | ||
expect(result.response.data).toHaveProperty("vehicles"); | ||
}); | ||
|
||
test("Lock Door", async () => { | ||
const result = await onStar.lockDoor(); | ||
|
||
expect(result.status).toEqual("success"); | ||
expect(result.response.data).toHaveProperty("commandResponse"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
test/RequestService.test.ts → test/unit/RequestService.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters