Skip to content

Commit

Permalink
EP init in test
Browse files Browse the repository at this point in the history
  • Loading branch information
enjikaka committed Apr 5, 2024
1 parent 795e4d5 commit 8674ec1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/player/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@rollup/plugin-typescript": "11.1.6",
"@tidal-music/auth": "workspace:^",
"@tidal-music/common": "workspace:^",
"@tidal-music/event-producer": "workspace:^",
"@tidal-music/true-time": "workspace:^",
"@types/js-levenshtein": "1.1.3",
"@types/mocha": "10.0.6",
Expand Down
20 changes: 20 additions & 0 deletions packages/player/src/test-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-console */
import * as Auth from '@tidal-music/auth';
import * as EventProducer from '@tidal-music/event-producer';

import { playerState } from './player/state';

Expand Down Expand Up @@ -44,6 +45,25 @@ await Auth.setCredentials({
});

Player.setCredentialsProvider(Auth.credentialsProvider);

EventProducer.init({
appInfo: { appName: 'TIDAL SDK Player Module test', appVersion: '0.0.0' },
blockedConsentCategories: {
NECESSARY: false,
PERFORMANCE: false,
TARGETING: false,
},
credentialsProvider: Auth.credentialsProvider,
platform: {
browserName: 'Web Test Runner',
browserVersion: '0.0.0',
osName: 'GitHub Actions',
},
strictMode: false,
tlConsumerUri: 'https://api.tidal.com/api/event-batch',
tlPublicConsumerUri: 'https://api.tidal.com/api/public/event-batch',
});

export const credentialsProvider = Auth.credentialsProvider;

export function waitForEvent(target: EventTarget, eventName: string) {
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 8674ec1

Please sign in to comment.