Skip to content

Commit

Permalink
Build on node 16
Browse files Browse the repository at this point in the history
Widen expectation due to flakyness
  • Loading branch information
Thom van Kalkeren committed Aug 12, 2021
1 parent 31673e3 commit 38b85cb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
34 changes: 17 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,58 +19,58 @@ jobs:
paths:
- cc-test-reporter

build-node-14:
build-node-16:
<<: *defaults
docker:
- image: circleci/node:14
- image: circleci/node:16
steps:
- checkout
- attach_workspace:
at: ~/link-lib/tmp
- restore_cache:
keys:
- v1-dependencies-14-{{ checksum "package.json" }}
- v1-dependencies-16-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-14-
- v1-dependencies-16-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-14-{{ checksum "package.json" }}
key: v1-dependencies-16-{{ checksum "package.json" }}
- run: yarn lint
- run: yarn test -w 1
- run: ./tmp/cc-test-reporter format-coverage -t lcov -o ~/link-lib/tmp/codeclimate.node-14.json coverage/lcov.info
- run: yarn build
- persist_to_workspace:
root: tmp
paths:
- codeclimate.node-14.json

build-node-13:
build-node-14:
<<: *defaults
docker:
- image: circleci/node:13
- image: circleci/node:14
steps:
- checkout
- attach_workspace:
at: ~/link-lib/tmp
- restore_cache:
keys:
- v1-dependencies-13-{{ checksum "package.json" }}
- v1-dependencies-14-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-13-
- v1-dependencies-14-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-13-{{ checksum "package.json" }}
key: v1-dependencies-14-{{ checksum "package.json" }}
- run: yarn lint
- run: yarn test -w 1
- run: ./tmp/cc-test-reporter format-coverage -t lcov -o ~/link-lib/tmp/codeclimate.node-14.json coverage/lcov.info
- run: yarn build
- persist_to_workspace:
root: tmp
paths:
- codeclimate.node-14.json

build-node-12:
<<: *defaults
Expand All @@ -97,7 +97,7 @@ jobs:
upload-coverage:
<<: *defaults
environment:
- CC_TEST_REPORTER_ID: c5cb6a4fe5e0beaf6d812394bcedd0f15e70ddf035fc1f51ea0ea2a842fdcfad
CC_TEST_REPORTER_ID: f49a72b364886e0b9aae7a678c2fc1235276270cce13dc92f0b856f3438df624
steps:
- attach_workspace:
at: ~/link-lib/tmp
Expand All @@ -112,10 +112,10 @@ workflows:
commit:
jobs:
- build
- build-node-16
- build-node-14:
requires:
- build
- build-node-13
- build-node-12
- upload-coverage:
requires:
Expand Down
6 changes: 4 additions & 2 deletions src/__tests__/LinkedRenderStore/subscriptions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ describe("LinkedRenderStore", () => {
});

it("calls the subscription when relevant", async () => {
jest.useRealTimers();

const store = getBasicStore();
await store.forceBroadcast();
const callback = jest.fn();
Expand All @@ -127,14 +129,14 @@ describe("LinkedRenderStore", () => {

store.store.addQuads([rdfFactory.quad(schemaT, schema.name, rdfFactory.literal("Thing"))]);
await store.forceBroadcast();
jest.runAllTimers();

expect(callback).toHaveBeenCalledTimes(1);
expect(callback.mock.calls[0][0]).toEqual([
rdfFactory.id(schemaT),
rdfFactory.id(store.store.defaultGraph()),
]);
expect(callback.mock.calls[0][1]).toBeGreaterThanOrEqual(reg.subscribedAt!);
expect(callback.mock.calls[0][1]).toBeLessThan(Date.now());
expect(callback.mock.calls[0][1]).toBeLessThanOrEqual(Date.now());
});
});
});
Expand Down

0 comments on commit 38b85cb

Please sign in to comment.