Skip to content

Commit

Permalink
✅ Increase configure() test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Dec 4, 2024
1 parent d89c8ab commit ed2cf9c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ jobs:
with:
files: ./coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
17 changes: 17 additions & 0 deletions src/library.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import axios from "axios";
import sinon from "sinon";

import { configure, createAuthService } from "../src/library";
import { API_URL } from "./constants";

describe("library", () => {
let axiosStub: sinon.SinonStub;
Expand Down Expand Up @@ -95,6 +96,22 @@ describe("library", () => {
"setPowerOn",
]);
});
it("should create API methods with the default baseURL", () => {
const api = configure();
assert.deepEqual(axiosStub.args, [
[
{
baseURL: API_URL,
},
],
]);
assert.deepEqual(Object.keys(api), [
"deviceInfo",
"setPower",
"setPowerOff",
"setPowerOn",
]);
});
});

describe("API Methods", () => {
Expand Down

0 comments on commit ed2cf9c

Please sign in to comment.