Skip to content

Commit

Permalink
Tsconfig library updates (#35)
Browse files Browse the repository at this point in the history
* Update tsconfig for node16 module code generation

* Add nock for http request mocking

* Linter fixes

* Remove jest reference
  • Loading branch information
dmoss18 authored Mar 8, 2024
1 parent 40448b6 commit 51803ba
Show file tree
Hide file tree
Showing 6 changed files with 1,499 additions and 1,335 deletions.
18 changes: 13 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
const config = {
preset: 'ts-jest',
preset: 'ts-jest/presets/default-esm',
setupFiles: ['dotenv/config'],
testEnvironment: 'node',
transform: {
'^.+\\.ts?$': 'ts-jest',
},
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'(.+)\\.js': '$1',
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
},
],
},
transformIgnorePatterns: ['<rootDir>/node_modules/'],
};
Expand Down
8 changes: 4 additions & 4 deletions lib/tastytrade-api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import TastytradeHttpClient from "./services/tastytrade-http-client.js"
import { AccountStreamer, STREAMER_STATE, Disposer, StreamerStateObserver } from './account-streamer.js'
import MarketDataStreamer, { CandleSubscriptionOptions, CandleType, MarketDataSubscriptionType, MarketDataListener } from "./market-data-streamer.js"
import { AccountStreamer, STREAMER_STATE, type Disposer, type StreamerStateObserver } from './account-streamer.js'
import MarketDataStreamer, { type CandleSubscriptionOptions, CandleType, MarketDataSubscriptionType, type MarketDataListener } from "./market-data-streamer.js"

//Services:
import SessionService from "./services/session-service.js"
Expand Down Expand Up @@ -61,5 +61,5 @@ export default class TastytradeClient {
}
}

export { MarketDataStreamer, MarketDataSubscriptionType, MarketDataListener, CandleSubscriptionOptions, CandleType }
export { AccountStreamer, STREAMER_STATE, Disposer, StreamerStateObserver }
export { MarketDataStreamer, MarketDataSubscriptionType, type MarketDataListener, type CandleSubscriptionOptions, CandleType }
export { AccountStreamer, STREAMER_STATE, type Disposer, type StreamerStateObserver }
Loading

0 comments on commit 51803ba

Please sign in to comment.