From bdacbeb095da2be8c9fe0b9974edb990621882bd Mon Sep 17 00:00:00 2001 From: Allan Hortle Date: Tue, 10 Oct 2023 08:59:43 +1100 Subject: [PATCH] Fix up build scripts --- .github/workflows/test.yml | 8 ++++---- .node-version | 1 + lerna.json | 4 +--- package.json | 8 ++++---- packages/react-enty/package.json | 2 +- .../react-enty/src/__tests__/ProviderFactory-test.tsx | 2 -- packages/react-enty/src/setupEnzyme.ts | 6 +++--- packages/react-enty/yarn.lock | 5 ----- 8 files changed, 14 insertions(+), 22 deletions(-) create mode 100644 .node-version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 94898284..ce93f261 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,9 +4,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '18' - run: yarn prep - - run: yarn test-all + - run: yarn test:all diff --git a/.node-version b/.node-version new file mode 100644 index 00000000..3f430af8 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +v18 diff --git a/lerna.json b/lerna.json index 7e8edca5..d941560f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,5 @@ { "npmClient": "yarn", "version": "2.0.0-alpha.16", - "packages": [ - "packages/*" - ] + "packages": ["packages/*"] } diff --git a/package.json b/package.json index 5873c40a..e8070725 100644 --- a/package.json +++ b/package.json @@ -7,15 +7,15 @@ "prep": "yarn && yarn lerna bootstrap", "build": "lerna run build", "pub": "yarn build && yarn lerna publish", - "pub-next": "yarn build && yarn lerna publish --npm-tag=next", + "pub:next": "yarn build && yarn lerna publish --npm-tag=next", "watch": "lerna run watch --parallel --", - "test-all": "lerna run test-all", + "test:all": "lerna run test:all", "format": "yarn prettier --write .", - "format-quick": "yarn pretty-quick --staged" + "format:quick": "yarn pretty-quick --staged" }, "husky": { "hooks": { - "pre-commit": "yarn format-quick" + "pre-commit": "yarn format:quick" } }, "devDependencies": { diff --git a/packages/react-enty/package.json b/packages/react-enty/package.json index e1efbb1f..31e9835d 100644 --- a/packages/react-enty/package.json +++ b/packages/react-enty/package.json @@ -34,7 +34,7 @@ "lint": "yarn tsdx lint src", "prepublishOnly": "yarn build", "test": "yarn jest", - "test-all": "yarn test && yarn build", + "test:all": "yarn test && yarn build", "watch": "yarn tsdx watch", "size": "size-limit" }, diff --git a/packages/react-enty/src/__tests__/ProviderFactory-test.tsx b/packages/react-enty/src/__tests__/ProviderFactory-test.tsx index e4cd3fc4..25d9a492 100644 --- a/packages/react-enty/src/__tests__/ProviderFactory-test.tsx +++ b/packages/react-enty/src/__tests__/ProviderFactory-test.tsx @@ -157,9 +157,7 @@ describe('Debugging', () => { const log = jest.spyOn(console, 'log').mockImplementation(() => {}); const {Provider} = ProviderFactory({}); mount(); - expect(log).toHaveBeenCalled(); - log.mockRestore(); }); }); diff --git a/packages/react-enty/src/setupEnzyme.ts b/packages/react-enty/src/setupEnzyme.ts index 93925d4e..32692877 100644 --- a/packages/react-enty/src/setupEnzyme.ts +++ b/packages/react-enty/src/setupEnzyme.ts @@ -2,11 +2,11 @@ import {configure} from 'enzyme'; import EnzymeAdapter from '@wojtekmaj/enzyme-adapter-react-17'; configure({adapter: new EnzymeAdapter()}); -const mockConsoleMethod = realConsoleMethod => { +const mockConsoleMethod = (realConsoleMethod: any) => { const ignoredMessages = ['test was not wrapped in act(...)']; - return (message, ...args) => { - const containsIgnoredMessage = ignoredMessages.some(ignoredMessage => + return (message: any, ...args: any[]) => { + const containsIgnoredMessage = ignoredMessages.some((ignoredMessage) => message.includes(ignoredMessage) ); diff --git a/packages/react-enty/yarn.lock b/packages/react-enty/yarn.lock index 5cb2b066..339286fc 100644 --- a/packages/react-enty/yarn.lock +++ b/packages/react-enty/yarn.lock @@ -3825,11 +3825,6 @@ entities@^2.0.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== -enty@^2.0.0-alpha.16: - version "2.0.0-alpha.16" - resolved "https://registry.yarnpkg.com/enty/-/enty-2.0.0-alpha.16.tgz#4dc2185466d1732a119f7b1463a5bdf6c706c183" - integrity sha512-huWNHs30cRrDvg1+j3gGOMHth2QayssZLYHwhnBCfHLr14AOKirlkAvqdBKq6FbBvbb2qROjtW23zukqL8SwhQ== - enzyme-matchers@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/enzyme-matchers/-/enzyme-matchers-7.1.2.tgz#d80530a61f22d28bb993dd7588abba38bd4de282"