Skip to content

Commit e2f320b

Browse files
Muhamad RidwanMuhamad Ridwan
authored andcommitted
fix: update setup
1 parent b4f8e95 commit e2f320b

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

jest.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const config: Config = {
44
preset: 'ts-jest',
55
testEnvironment: 'node',
66
setupFiles: ['./jest.setup.ts'],
7+
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
8+
modulePathIgnorePatterns: ['/dist/'],
79
};
810

911
export default config;

jest.setup.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
import * as dotenv from 'dotenv';
33

44
// Load .env.integration_test if it exists, fallback to .env
5-
dotenv.config({ path: '.env.test' });
6-
console.log('setup file');
5+
dotenv.config({ path: '.env.test' });

tests/integration/groupChannel.test.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ import {
1111
SendbirdSmsFallback,
1212
SendbirdUser,
1313
} from "../../models/ObjectSerializer";
14-
import { PromiseGroupChannelApi } from "../../types/PromiseAPI";
15-
import * as sendbird from "../..";
1614
import { hasValidField } from "./helper";
15+
import { ServerConfiguration } from "../../servers";
16+
import { createConfiguration } from "../../configuration";
17+
import { GroupChannelApi } from "../../index";
1718

1819
describe("Group Channel API", () => {
1920
const APP_ID = process.env.APP_ID || '';
2021
const API_TOKEN = process.env.API_TOKEN || '';
21-
let groupChannelApi: PromiseGroupChannelApi;
22+
let groupChannelApi: GroupChannelApi;
2223
const validSendbirdGroupChannelCountPreferenceEnum: (
2324
| SendbirdGroupChannelCountPreferenceEnum
2425
| undefined
@@ -49,14 +50,14 @@ describe("Group Channel API", () => {
4950
)[] = ["all", "default", "false", "mention_only"];
5051

5152
beforeEach(() => {
52-
const serverConfig = new sendbird.ServerConfiguration(
53-
"https://api-AE479FF2-A3BC-49C2-A3FD-B7F779B7F4C5.sendbird.com",
53+
const serverConfig = new ServerConfiguration(
54+
`https://api-${APP_ID}.sendbird.com`,
5455
{ app_id: APP_ID }
5556
);
56-
const configuration = sendbird.createConfiguration({
57+
const configuration = createConfiguration({
5758
baseServer: serverConfig,
5859
});
59-
groupChannelApi = new sendbird.GroupChannelApi(configuration);
60+
groupChannelApi = new GroupChannelApi(configuration);
6061
});
6162

6263
it("call listChannels with positive query params", async () => {

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"strict": true,
44
/* Basic Options */
5-
"target": "es5",
5+
"target": "ES2015",
66
"moduleResolution": "node",
77
"declaration": true,
88

@@ -16,7 +16,7 @@
1616
"sourceMap": true,
1717
"outDir": "./dist",
1818
"noLib": false,
19-
"lib": [ "es6" ],
19+
"lib": [ "ES2015" ],
2020
"types": ["jest"]
2121
},
2222
"exclude": [

0 commit comments

Comments
 (0)