Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: verify importing js exports works before versioning #239

Merged
merged 17 commits into from Oct 23, 2023

Conversation

skjalgepalg
Copy link
Collaborator

@skjalgepalg skjalgepalg commented Oct 9, 2023

Use testpack-cli to pack and install repo in separate test-folder to verify js exports in preversion step.

  • add new test script
    • imports icons, expressive variants, logos and previews to an mjs and js -file and logs the number of icons in each category
    • This will parse all the icons and fail if we attempt to ship invalid js syntax
    • Installs React for testpack-cli and does the above check for jsx exports as well.
      • Note that adding jsx exports will break the test-script for runs without the testpack-cli context
        • Uncertain if there is a way to make React available for running npm run test
    • Evaluates core-icons-iife.js into a jsdom instance and counts the number of children inside the generated <svg>-tag to verify that it runs as intended.
  • Runs the test-script in a GitHub action
  • Check CommonJS exports
  • Check ESM exports
  • Check CommonJS exports for React/JSX
  • Check ESM exports for React/JSX
  • Verify types
  • Check large icons
  • Check iife file

Note: this PR does not address jsx/react exports yet

@skjalgepalg skjalgepalg marked this pull request as ready for review October 19, 2023 07:25
Copy link

@ajaco ajaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ser fint ut for mine øyne det her, men mistenker en kommentar kan slettes

test/core-icons-iife.test.js Outdated Show resolved Hide resolved
@skjalgepalg skjalgepalg merged commit 1e42eb3 into master Oct 23, 2023
1 check passed
@skjalgepalg skjalgepalg deleted the test-package-before-publish branch October 23, 2023 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants