Skip to content

Commit

Permalink
chore: run pj build
Browse files Browse the repository at this point in the history
  • Loading branch information
aripalo committed Nov 19, 2024
1 parent e2592d1 commit a3565e7
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 115 deletions.
20 changes: 10 additions & 10 deletions src/smartstack/tags/checks.test.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { useCompatibilityV0Tags, useLegacyTags } from "./checks";
import { TestableResource } from "./test-helpers/TestableResource";
import { useCompatibilityV0Tags, useLegacyTags } from './checks';
import { TestableResource } from './test-helpers/TestableResource';

describe("useLegacyTags", () => {
test("returns false if the context key is not set", () => {
describe('useLegacyTags', () => {
test('returns false if the context key is not set', () => {
const scope = new TestableResource();
expect(useLegacyTags(scope)).toBe(false);
});

test("returns true if the context key is set", () => {
test('returns true if the context key is set', () => {
const scope = new TestableResource({
context: {
"@alma-cdk/project:legacyTags": true,
'@alma-cdk/project:legacyTags': true,
},
});
expect(useLegacyTags(scope)).toBe(true);
});
});

describe("useCompatibilityV0Tags", () => {
test("returns false if the context key is not set", () => {
describe('useCompatibilityV0Tags', () => {
test('returns false if the context key is not set', () => {
const scope = new TestableResource();
expect(useCompatibilityV0Tags(scope)).toBe(false);
});

test("returns true if the context key is set", () => {
test('returns true if the context key is set', () => {
const scope = new TestableResource({
context: {
"@alma-cdk/project:compatibility:v0:tags": true,
'@alma-cdk/project:compatibility:v0:tags': true,
},
});
expect(useCompatibilityV0Tags(scope)).toBe(true);
Expand Down
4 changes: 2 additions & 2 deletions src/smartstack/tags/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function hasEnvironment(values: Values): boolean {
/**
* Enforces usage of https://github.com/almamedia/alma-cdk-jsii-tag-and-name
* (for AWS CDK v1) compatible tagging behavior.
*
*
* @deprecated This behavior is not encouraged and will be removed in v2. Additionally according to GitHub search, this is not used anymore.
*/
export function useLegacyTags(scope: Construct): boolean {
Expand All @@ -26,7 +26,7 @@ export function useLegacyTags(scope: Construct): boolean {
* Due to a bug in v0, the `Contact` and `Organization` tags were NOT applied as they should have.
* This flag can be used to enforce behavior that matches v0 implementation:
* I.e. `Contact` and `Organization` tags are NOT applied.
*
*
* @deprecated This behavior is not encouraged and will be removed in v2.
*/
export function useCompatibilityV0Tags(scope: Construct): boolean {
Expand Down
Loading

0 comments on commit a3565e7

Please sign in to comment.