Skip to content

Commit

Permalink
Add new apprentice test for dynamic timestamp (#75)
Browse files Browse the repository at this point in the history
* added a new apprentice test to ensure they have dynamic timestamps

* changed up test from seconds to milliseconds

* fixed typo

* updated name of test
  • Loading branch information
jburns24 authored Apr 11, 2024
1 parent 5d1fa21 commit 0b41561
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apprentice-action/tests/endpoint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ describe("Tests to the \"/\" endpoint", () => {
const res = await axios(`http://${dockerBridgeIP}:80/`);
expect(res.data.timestamp).to.be.a("number");
});
it("should return a timestamp within a few seconds of now", async () => {
const res = await axios(`http://${dockerBridgeIP}:80/`);
const now = Date.now();
expect(res.data.timestamp).to.be.within(now - 5000, now);
});
});

0 comments on commit 0b41561

Please sign in to comment.