Skip to content

Commit

Permalink
[Communication][Chat] Changes required for min-max testing (Azure#14942)
Browse files Browse the repository at this point in the history
* Moving tests under public folder

* enabling minmax jobs

* disabling minmax test for now

* moving files referencing generated under /internal

* nit fix command
  • Loading branch information
armansabaa authored and vindicatesociety committed Apr 26, 2021
1 parent d016a96 commit d6c1570
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion sdk/communication/communication-chat/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/*.spec.ts"
"${workspaceFolder}/test/**/*.spec.ts"
],
"env": {
"TS_NODE_COMPILER_OPTIONS": "{\"module\": \"commonjs\"}",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 \"dist-esm/test/*.spec.js\" \"dist-esm/test/node/*.spec.js\"",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 dist-esm/test/public/*.spec.js dist-esm/test/public/node/*.spec.js",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
Expand Down
14 changes: 12 additions & 2 deletions sdk/communication/communication-chat/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ export function nodeConfig(test = false) {

if (test) {
// Entry points - test files under the `test` folder(common for both browser and node), node specific test files
baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/node/*.spec.js"];
baseConfig.input = [
"dist-esm/test/public/*.spec.js",
"dist-esm/test/internal/*.spec.js",
"dist-esm/test/public/node/*.spec.js",
"dist-esm/test/internal/node/*.spec.js"
];
baseConfig.plugins.unshift(multiEntry({ exports: false }));

// different output file
Expand Down Expand Up @@ -110,7 +115,12 @@ export function browserConfig(test = false) {

if (test) {
// Entry points - test files under the `test` folder(common for both browser and node), browser specific test files
baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/browser/*.spec.js"];
baseConfig.input = [
"dist-esm/test/public/*.spec.js",
"dist-esm/test/internal/*.spec.js",
"dist-esm/test/public/browser/*.spec.js",
"dist-esm/test/internal/browser/*.spec.js"
];
baseConfig.plugins.unshift(multiEntry({ exports: false }));
baseConfig.output.file = "dist-test/index.browser.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import sinon from "sinon";
import { assert } from "chai";
import { ChatClient, CreateChatThreadRequest } from "../src";
import * as RestModel from "../src/generated/src/models";
import { apiVersion } from "../src/generated/src/models/parameters";
import { baseUri, generateToken } from "./utils/connectionUtils";
import { ChatClient, CreateChatThreadRequest } from "../../src";
import * as RestModel from "../../src/generated/src/models";
import { apiVersion } from "../../src/generated/src/models/parameters";
import { baseUri, generateToken } from "../public/utils/connectionUtils";
import {
AzureCommunicationTokenCredential,
CommunicationUserIdentifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {
SendMessageOptions,
UpdateMessageOptions,
AddParticipantsRequest
} from "../src";
import * as RestModel from "../src/generated/src/models";
import { apiVersion } from "../src/generated/src/models/parameters";
import { baseUri, generateToken } from "./utils/connectionUtils";
} from "../../src";
import * as RestModel from "../../src/generated/src/models";
import { apiVersion } from "../../src/generated/src/models/parameters";
import { baseUri, generateToken } from "../public/utils/connectionUtils";
import {
generateHttpClient,
createChatThreadClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import { AzureCommunicationTokenCredential } from "@azure/communication-common";
import { HttpClient, HttpHeaders, WebResourceLike, HttpOperationResponse } from "@azure/core-http";
import * as RestModel from "../../src/generated/src/models";
import { ChatClient, ChatParticipant, ChatThreadClient } from "../../src";
import { CommunicationIdentifierModel } from "../../src/generated/src";
import { baseUri, generateToken } from "./connectionUtils";
import * as RestModel from "../../../src/generated/src/models";
import { ChatClient, ChatParticipant, ChatThreadClient } from "../../../src";
import { CommunicationIdentifierModel } from "../../../src/generated/src";
import { baseUri, generateToken } from "../../public/utils/connectionUtils";

export const mockCommunicationIdentifier: CommunicationIdentifierModel = {
communicationUser: { id: "id" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { isLiveMode, Recorder } from "@azure/test-utils-recorder";
import { assert } from "chai";
import { ChatClient, ChatThreadClient } from "../src";
import { ChatClient, ChatThreadClient } from "../../src";
import { createTestUser, createRecorder, createChatClient } from "./utils/recordedClient";
import { isNode } from "@azure/core-http";
import sinon from "sinon";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { Recorder } from "@azure/test-utils-recorder";
import { assert } from "chai";
import { ChatClient, ChatThreadClient } from "../src";
import { ChatClient, ChatThreadClient } from "../../src";
import { createTestUser, createRecorder, createChatClient } from "./utils/recordedClient";
import { CommunicationIdentifier, getIdentifierKind } from "@azure/communication-common";
import { Context } from "mocha";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
isNode,
WebResourceLike
} from "@azure/core-http";
import { ChatClient } from "../../src";
import { ChatClient } from "../../../src";
import {
CommunicationUserIdentifier,
AzureCommunicationTokenCredential,
Expand Down

0 comments on commit d6c1570

Please sign in to comment.