Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KeyVault-Secrets] Proposed test folders #9211

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/keyvault/keyvault-secrets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../.prettierrc.json \"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 --timeout 180000 --full-trace dist-esm/test/*.test.js",
"integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/test/*.test.js",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/test/**/*.spec.js",
"integration-test:node:no-timeout": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --no-timeouts --full-trace dist-esm/test/**/*.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 -f html -o keyvault-secrets-lintReport.html",
Expand Down
4 changes: 2 additions & 2 deletions sdk/keyvault/keyvault-secrets/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function nodeConfig(test = false) {

if (test) {
// entry point is every test file
baseConfig.input = ["dist-esm/test/*.test.js"];
baseConfig.input = ["dist-esm/test/**/*.spec.js"];
baseConfig.plugins.unshift(
multiEntry({ exports: false }),
json() // This allows us to import/require the package.json file, to get the version and test it against the user agent.
Expand Down Expand Up @@ -127,7 +127,7 @@ export function browserConfig(test = false) {
};

if (test) {
baseConfig.input = ["dist-esm/test/*.test.js"];
baseConfig.input = ["dist-esm/test/**/*.spec.js"];
baseConfig.plugins.unshift(
multiEntry({ exports: false }),
json() // This allows us to import/require the package.json file, to get the version and test it against the user agent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Licensed under the MIT license.

import * as assert from "assert";
import { SecretClient } from "../src";
import { SecretClient } from "../../src";
import { env, Recorder } from "@azure/test-utils-recorder";
import { authenticate } from "./utils/testAuthentication";
import TestClient from "./utils/testClient";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../utils/testClient";
import {
AuthenticationChallengeCache,
AuthenticationChallenge,
parseWWWAuthenticate
} from "../src/core/challengeBasedAuthenticationPolicy";
} from "../../src/core/challengeBasedAuthenticationPolicy";
import { createSandbox } from "sinon";

// Following the philosophy of not testing the insides if we can test the outsides...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Licensed under the MIT license.

import * as assert from "assert";
import { version } from "../package.json";
import { SDK_VERSION } from "../src/core/utils/constants";
import { packageVersion } from "../src/core/keyVaultClientContext";
import { version } from "../../package.json";
import { SDK_VERSION } from "../../src/core/utils/constants";
import { packageVersion } from "../../src/core/keyVaultClientContext";

describe("Secrets client's user agent", () => {
// The tests follow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Licensed under the MIT license.

import * as assert from "assert";
import { SecretClient } from "../src";
import { testPollerProperties } from "./utils/recorderUtils";
import { SecretClient } from "../../src";
import { testPollerProperties } from "../utils/recorderUtils";
import { env, Recorder } from "@azure/test-utils-recorder";
import { authenticate } from "./utils/testAuthentication";
import TestClient from "./utils/testClient";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../utils/testClient";
import { AbortController } from "@azure/abort-controller";
import { assertThrowsAbortError } from "./utils/utils.common";
import { assertThrowsAbortError } from "../utils/utils.common";

describe("Secret client - create, read, update and delete operations", () => {
const secretValue = "SECRET_VALUE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import * as assert from "assert";
import chai from "chai";
import { SecretClient } from "../src";
import { testPollerProperties } from "./utils/recorderUtils";
import { SecretClient } from "../../src";
import { testPollerProperties } from "../utils/recorderUtils";
import { env, Recorder, isRecordMode } from "@azure/test-utils-recorder";
import { authenticate } from "./utils/testAuthentication";
import TestClient from "./utils/testClient";
import { assertThrowsAbortError } from "./utils/utils.common";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../utils/testClient";
import { assertThrowsAbortError } from "../utils/utils.common";
const { expect } = chai;

describe("Secret client - list secrets in various ways", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Licensed under the MIT license.

import * as assert from "assert";
import { SecretClient, DeletedSecret } from "../src";
import { testPollerProperties } from "./utils/recorderUtils";
import { SecretClient, DeletedSecret } from "../../src";
import { testPollerProperties } from "../utils/recorderUtils";
import { env, Recorder } from "@azure/test-utils-recorder";
import { authenticate } from "./utils/testAuthentication";
import TestClient from "./utils/testClient";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../utils/testClient";
import { PollerStoppedError } from "@azure/core-lro";
import { assertThrowsAbortError } from "./utils/utils.common";
import { assertThrowsAbortError } from "../utils/utils.common";

describe("Secrets client - Long Running Operations - delete", () => {
const secretPrefix = `recover${env.CERTIFICATE_NAME || "SecretName"}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Licensed under the MIT license.

import * as assert from "assert";
import { SecretClient, SecretProperties } from "../src";
import { testPollerProperties } from "./utils/recorderUtils";
import { SecretClient, SecretProperties } from "../../src";
import { testPollerProperties } from "../utils/recorderUtils";
import { env, Recorder } from "@azure/test-utils-recorder";
import { authenticate } from "./utils/testAuthentication";
import TestClient from "./utils/testClient";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../utils/testClient";
import { PollerStoppedError } from "@azure/core-lro";
import { assertThrowsAbortError } from "./utils/utils.common";
import { assertThrowsAbortError } from "../utils/utils.common";

describe("Secrets client - Long Running Operations - recoverDelete", () => {
const secretPrefix = `recover${env.CERTIFICATE_NAME || "SecretName"}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Licensed under the MIT license.

import * as assert from "assert";
import { SecretClient } from "../src";
import { SecretClient } from "../../src";
import { isNode } from "@azure/core-http";
import { testPollerProperties } from "./utils/recorderUtils";
import { testPollerProperties } from "../utils/recorderUtils";
import { env, isPlaybackMode, Recorder, delay, isRecordMode } from "@azure/test-utils-recorder";
import { authenticate } from "./utils/testAuthentication";
import TestClient from "./utils/testClient";
import { assertThrowsAbortError } from "./utils/utils.common";
import { authenticate } from "../utils/testAuthentication";
import TestClient from "../utils/testClient";
import { assertThrowsAbortError } from "../utils/utils.common";

describe("Secret client - restore secrets and recover backups", () => {
const secretPrefix = `CRUD${env.SECRET_NAME || "SecretName"}`;
Expand Down