Skip to content

fix: Add Test Framework#11

Merged
alexs-mparticle merged 5 commits intodevelopmentfrom
fix/SQDSDKS-7169-add-tests
Mar 27, 2025
Merged

fix: Add Test Framework#11
alexs-mparticle merged 5 commits intodevelopmentfrom
fix/SQDSDKS-7169-add-tests

Conversation

@alexs-mparticle
Copy link
Collaborator

Summary

  • Introduces automated test framework to Kit

Testing Plan

  • Run automated tests

@alexs-mparticle alexs-mparticle marked this pull request as ready for review March 25, 2025 19:14
Copy link
Collaborator

@rmi22186 rmi22186 left a comment

Choose a reason for hiding this comment

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

mostly lgtm. tiny nits

this.createLauncherCalled = false;
this.createLauncher = function (options) {
self.accountId = options.accountId;
self.sandbox = options.sandbox;
Copy link
Collaborator

Choose a reason for hiding this comment

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

note that we will remove this in a future PR and use the isDevelopmentMode flag. this will make it a bit harder to test since we'd have to init the mParticle SDK, although we could just mock it and simplify it a ton.

// window.MockXYZForwarder.userId.should.equal('123');

done();
const waitForCondition = function async(
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'd bring this higher up in the file. feels weird to have it at the bottom.

var moduleId = 181;

function attachLauncher(accountId, sandboxMode) {
window.Rokt.createLauncher({
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor, just wanted to check if we could start using async/await?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can't really use async/await because this file isn't being transpiled and we need kits to be as es5 as possible.

Copy link
Collaborator

Choose a reason for hiding this comment

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

^^ this. technically even promises aren't ES5, but since your customer base is all.

As an FYI to Ryan, we've had to support ES5 primarily because some media customers use our web SDK on very old devices, like smart TVs from early 2000s. Theoretically they'd probably not be using Rokt on those devices, but for now let's do it this way until we get kits properly transpiled.

@alexs-mparticle alexs-mparticle force-pushed the fix/SQDSDKS-7169-add-tests branch from 011d7ee to 00c12df Compare March 27, 2025 16:51
@alexs-mparticle alexs-mparticle merged commit 75ef115 into development Mar 27, 2025
4 checks passed
crisryantan added a commit that referenced this pull request Mar 31, 2025
…ion-name

* development:
  feat: Add User Filtering to Kit (#9)
  fix: Add Test Framework (#11)
  feat: replace sandboxMode check with mParticle.getEnvironment() (#12)
  chore(build): Generate latest bundle [skip ci]
  fix: Reduce Rokt Kit Bundle Size (#7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants