diff --git a/Jenkinsfile.library b/Jenkinsfile.library index 1efbcaf91..cd79b5d47 100644 --- a/Jenkinsfile.library +++ b/Jenkinsfile.library @@ -1,4 +1,4 @@ -@Library('shared-library') _ +@Library('shared-library@sonar-for-sdk1') _ def pipelineConfig = [ "JSpublicLibrary": "true", diff --git a/packages/sdk/test/test-class.spec.ts b/packages/sdk/test/test-class.spec.ts new file mode 100644 index 000000000..b0aeb08d9 --- /dev/null +++ b/packages/sdk/test/test-class.spec.ts @@ -0,0 +1,19 @@ +import { sum2 } from "./test-class1" + +describe("sum", () => { + it("should return the sum of two positive numbers", () => { + expect(sum2(1, 2)).toBe(3) + }) + + it("should return the sum of two negative numbers", () => { + expect(sum2(-1, -2)).toBe(-3) + }) + + it("should return the sum of a positive and a negative number", () => { + expect(sum2(1, -2)).toBe(-1) + }) + + it("should return the sum of zero and a number", () => { + expect(sum2(0, 5)).toBe(5) + }) +}) diff --git a/packages/sdk/test/test-class.ts b/packages/sdk/test/test-class.ts new file mode 100644 index 000000000..16c274704 --- /dev/null +++ b/packages/sdk/test/test-class.ts @@ -0,0 +1,3 @@ +export function sum1(a: number, c: number) { + return a + c +} diff --git a/packages/sdk/test/test-class1.ts b/packages/sdk/test/test-class1.ts new file mode 100644 index 000000000..8ade0b953 --- /dev/null +++ b/packages/sdk/test/test-class1.ts @@ -0,0 +1,3 @@ +export function sum2(a: number, c: number) { + return a + c +}