Skip to content

Commit

Permalink
Update package test (#52)
Browse files Browse the repository at this point in the history
* build: update deps for package tester

* test: add missing import in vitest tests
  • Loading branch information
ae9is committed Apr 28, 2024
1 parent 5bca0ea commit 81b71d7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/fontpicker/src/components/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference types="vitest" />
import { describe, it, expect } from 'vitest'
import { describe, it, expect, beforeEach } from 'vitest'
import { act, screen, render, within, userEvent } from '../test/utils'
import App from './App'

Expand Down
2 changes: 1 addition & 1 deletion test/pack-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

For testing `npm pack`s of the fontpicker and fontpicker-lite built packages, before publication to npm.

Only the lite package is included in the main.yml CI via fontpicker-lite/test-lite.sh, which calls pack-test's "npm run test". (The full fontpicker cache is ~700 MB and takes ~20 min of API requests to download.)
Only the lite package is included in the main.yml CI via fontpicker-lite/test-lite.sh, which calls pack-test's "npm run test". (The full fontpicker cache is ~800 MB and takes ~20 min of API requests to download.)

To do a visual inspection of the fontpicker and fontpicker-lite packages, first make sure the local packages are installed via `prep-pack-test.sh`. Then run: `npm run dev`.
21 changes: 10 additions & 11 deletions test/pack-test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/pack-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@vitejs/plugin-react-swc": "^3.4.1",
"react": ">=18",
"react-dom": ">=18",
"react-fontpicker-ts-lite": "file:../../packages/fontpicker-lite/react-fontpicker-ts-lite-0.3.1.tgz",
"react-fontpicker-ts-lite": "file:../../packages/fontpicker-lite/react-fontpicker-ts-lite-0.4.0.tgz",
"vite": "^4.5.2"
},
"devDependencies": {
Expand Down
8 changes: 5 additions & 3 deletions test/pack-test/src/Lite.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="vitest" />
import { describe, it, expect } from 'vitest'
import { render, within } from './test/utils'
import { describe, it, expect, beforeEach } from 'vitest'
import { act, render, within } from './test/utils'
import App from './Lite'

function checkFontLoaded(cssId: string) {
Expand All @@ -11,7 +11,9 @@ function checkFontLoaded(cssId: string) {
}

beforeEach(() => {
render(<App />)
act(() => {
render(<App />)
})
})

describe('<App />', () => {
Expand Down

0 comments on commit 81b71d7

Please sign in to comment.