Skip to content

Commit

Permalink
change default test behavior to ignore deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainMuller committed Jun 13, 2023
1 parent d408636 commit a90c06c
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 24 deletions.
2 changes: 0 additions & 2 deletions packages/@aws-cdk/region-info/test/default.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Default } from '../lib';

process.env.JSII_DEPRECATED = 'quiet';

const region = 'bermuda-triangle-42';
const urlSuffix = '.nowhere.null';

Expand Down
2 changes: 0 additions & 2 deletions packages/@aws-cdk/region-info/test/fact.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Fact, FactName } from '../lib';
import { AWS_REGIONS } from '../lib/aws-entities';

process.env.JSII_DEPRECATED = 'quiet';

describe('find', () => {
test('returns undefined for an unknown fact', () => {
expect(Fact.find(AWS_REGIONS[0], 'not:a:known:fact')).toBe(undefined);
Expand Down
2 changes: 0 additions & 2 deletions packages/@aws-cdk/region-info/test/region-info.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { CLOUDWATCH_LAMBDA_INSIGHTS_ARNS } from '../build-tools/fact-tables';
import { FactName, RegionInfo } from '../lib';
import { AWS_REGIONS, AWS_SERVICES } from '../lib/aws-entities';

process.env.JSII_DEPRECATED = 'quiet';

test('built-in data is correct', () => {
const snapshot: any = {};
for (const name of AWS_REGIONS) {
Expand Down
2 changes: 0 additions & 2 deletions packages/cdk-cli-wrapper/test/cdk-wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { RequireApproval } from '../lib/commands';
let spawnSyncMock: jest.SpyInstance;

beforeEach(() => {
process.env.JSII_DEPRECATED = 'silent';

spawnSyncMock = jest.spyOn(child_process, 'spawnSync').mockReturnValue({
status: 0,
stderr: Buffer.from('stderr'),
Expand Down
4 changes: 1 addition & 3 deletions tools/@aws-cdk/cdk-build-tools/bin/cdk-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ async function main() {
env: {
...defaultShellOptions.env,

// by default, fail when deprecated symbols are used in tests.
// tests that verify behaviour of deprecated symbols must use the `testDeprecated()` API.
JSII_DEPRECATED: 'fail',
JSII_DEPRECATED: 'quiet',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function isAlphaPackage(packageDir: string): boolean {
}

const maturity = pkg.maturity;
if (maturity !== 'experimental' && maturity !== 'developer-preview' && maturity !== 'deprecated') {
if (maturity !== 'experimental' && maturity !== 'developer-preview') {
return false;
}
// we're only interested in '@aws-cdk/' packages,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion tools/@aws-cdk/node-bundle/test/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as path from 'path';
import * as fs from 'fs-extra';
import { shell } from '../src/api/_shell';
import { Package } from './_package';
import { shell } from '../src/api/_shell';

test('validate', () => {

Expand Down

0 comments on commit a90c06c

Please sign in to comment.