Skip to content

Commit 8254c15

Browse files
committed
Lint + Fix 'max number of studies...' error
1 parent c0c3c81 commit 8254c15

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

tests/allErrors.test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { describe, it, expect } from 'vitest';
22
import TradingView from '../main';
33

4-
const token = process.env.SESSION as string;
5-
const signature = process.env.SIGNATURE as string;
4+
const token = <string>process.env.SESSION;
5+
const signature = <string>process.env.SIGNATURE;
66

77
describe('AllErrors', () => {
88
const waitForError = (instance: any) => new Promise<string[]>((resolve) => {
@@ -154,10 +154,15 @@ describe('AllErrors', () => {
154154
).rejects.toThrow('Inexistent or unsupported indicator: "undefined"');
155155
});
156156

157-
it('throws an error when setting an invalid study option value', async () => {
157+
it.skipIf(
158+
!token || !signature,
159+
)('throws an error when setting an invalid study option value', async () => {
158160
console.log('Testing "Invalid value" error:');
159161

160-
const client = new TradingView.Client();
162+
const client = new TradingView.Client({
163+
token,
164+
signature,
165+
});
161166
const chart = new client.Session.Chart();
162167

163168
chart.setMarket('BINANCE:BTCEUR'); // Set a market

0 commit comments

Comments
 (0)