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

[SDK-3920] Add a basic test of NPM package #1476

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Oct 30, 2023

Note: This PR is based on top of #1473; please review that one first.

This adds a package script test:package, which performs some basic testing to confirm that a browser-based TypeScript app is able to import the NPM package and use Ably functionality.

This hopefully gives us further confidence that we’ve correctly configured the package’s exports and typings. Next, we’ll build on top of this to add similar testing for the tree-shakable version of the library, once we’ve added typings for it in #1442.

Some of the approach here is copied from that used for testing the CDN bundle in the Spaces SDK.

Resolves #1474.

@github-actions github-actions bot temporarily deployed to staging/pull/1476/features October 30, 2023 20:10 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/features October 30, 2023 20:43 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc October 30, 2023 20:43 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/bundle-report October 30, 2023 20:44 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/features October 30, 2023 20:50 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/bundle-report October 30, 2023 20:50 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc October 30, 2023 20:51 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/features October 30, 2023 20:53 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc October 30, 2023 20:54 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/bundle-report October 30, 2023 20:54 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/features October 30, 2023 20:55 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/bundle-report October 30, 2023 20:56 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc October 30, 2023 20:56 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/features October 31, 2023 14:47 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/bundle-report October 31, 2023 14:48 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc October 31, 2023 14:48 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/features October 31, 2023 15:00 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/bundle-report October 31, 2023 15:01 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc October 31, 2023 15:01 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the 1474-package-test branch 2 times, most recently from 721c203 to ed0aea1 Compare October 31, 2023 15:45
@lawrence-forooghian lawrence-forooghian changed the base branch from integration/v2 to 1397-tree-shakable-MessageInteractions October 31, 2023 15:45
@github-actions github-actions bot temporarily deployed to staging/pull/1476/features October 31, 2023 15:46 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/bundle-report October 31, 2023 15:46 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc October 31, 2023 15:46 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc November 1, 2023 13:27 Inactive
@lawrence-forooghian lawrence-forooghian marked this pull request as draft November 1, 2023 18:33
@lawrence-forooghian lawrence-forooghian force-pushed the 1397-tree-shakable-MessageInteractions branch from 7c379cf to 53cafd4 Compare November 8, 2023 18:01
@github-actions github-actions bot temporarily deployed to staging/pull/1476/features November 8, 2023 18:15 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc November 8, 2023 18:16 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/bundle-report November 8, 2023 18:17 Inactive
@lawrence-forooghian lawrence-forooghian force-pushed the 1397-tree-shakable-MessageInteractions branch from 53cafd4 to 5c54465 Compare November 8, 2023 18:21
@github-actions github-actions bot temporarily deployed to staging/pull/1476/features November 8, 2023 18:22 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/typedoc November 8, 2023 18:23 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1476/bundle-report November 8, 2023 18:23 Inactive
@lawrence-forooghian lawrence-forooghian marked this pull request as ready for review November 9, 2023 13:30
Copy link
Member

@owenpearson owenpearson left a comment

Choose a reason for hiding this comment

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

This is a cool idea, I'm interested to see how useful this will end up being for catching errors/mistakes 👍

test/package/browser/template/README.md Outdated Show resolved Hide resolved
test/package/browser/template/test/package.test.ts Outdated Show resolved Hide resolved
@lawrence-forooghian lawrence-forooghian force-pushed the 1397-tree-shakable-MessageInteractions branch from 5c54465 to 6a96472 Compare November 14, 2023 18:53
When using this function to run `tsc`, noticed that it wasn’t outputting
any useful information about why that command failed, because all of the
error information was going to stdout.
This adds a package script `test:package`, which performs some basic
testing to confirm that a browser-based TypeScript app is able to import
the NPM package and use Ably functionality.

This hopefully gives us further confidence that we’ve correctly
configured the package’s exports and typings. Next, we’ll build on top
of this to add similar testing for the tree-shakable version of the
library, once we’ve added typings for it in #1442.

Some of the approach here is copied from that used for testing the CDN
bundle in the Spaces SDK (see commit fa95f9f there).

Resolves #1474.
Base automatically changed from 1397-tree-shakable-MessageInteractions to 1395-http-tree-shaking November 21, 2023 00:12
Base automatically changed from 1395-http-tree-shaking to integration/v2 November 21, 2023 00:16
@lawrence-forooghian lawrence-forooghian merged commit f378984 into integration/v2 Nov 21, 2023
12 checks passed
@lawrence-forooghian lawrence-forooghian deleted the 1474-package-test branch November 21, 2023 00:16
@VeskeR VeskeR mentioned this pull request Mar 1, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants