From 4a737b232ae35def89c74537742b59654576165c Mon Sep 17 00:00:00 2001 From: ajuvercr Date: Mon, 8 Apr 2024 15:54:26 +0200 Subject: [PATCH] add gh action tests --- .github/workflows/test.yml | 19 +++++++++++++++++++ test/configuration.test.ts | 11 ----------- test/connectors/file.test.ts | 1 - test/connectors/http.test.ts | 1 - test/processors.test.ts | 7 ------- 5 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..fa849ea --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,19 @@ +name: bun-test +on: + pull_request: + push: + branches: + - 'master' +jobs: + my-job: + name: bun-test + runs-on: ubuntu-latest + steps: + # ... + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v1 + + # run any `bun` or `bunx` command + - run: bun install + - run: bun test + diff --git a/test/configuration.test.ts b/test/configuration.test.ts index bafe28c..d8b2934 100644 --- a/test/configuration.test.ts +++ b/test/configuration.test.ts @@ -71,22 +71,11 @@ describe("Input test", () => { (x) => x.predicate.equals(RDF.terms.type) && x.object.equals(proc.ty), ) .map((x) => x.subject); - console.log( - "checking proc", - proc.ty.value, - subjects.map((x) => x.value), - ); const processorLens = config.lenses[proc.ty.value]; found.push( ...subjects.map((id) => processorLens.execute({ id, quads: quads })), ); } - - console.log( - config.shapes.map((x) => x.ty.value), - processors, - ); - console.log(found); }); }); diff --git a/test/connectors/file.test.ts b/test/connectors/file.test.ts index 1a6251a..40e7a48 100644 --- a/test/connectors/file.test.ts +++ b/test/connectors/file.test.ts @@ -40,7 +40,6 @@ describe("File Channel", () => { await sleep(300); expect(items.length).toBe(1); - console.log(items); expect(items[0].startsWith("Number 1")).toBeTruthy(); await writer.push("Number 2"); diff --git a/test/connectors/http.test.ts b/test/connectors/http.test.ts index 4bdd2c9..c46b5cd 100644 --- a/test/connectors/http.test.ts +++ b/test/connectors/http.test.ts @@ -65,7 +65,6 @@ describe("connector-http", () => { }); reader.data((data) => { - console.log("This reader works"); expect(Buffer.isBuffer(data)).toBeTruthy(); items.push(data.toString()); }); diff --git a/test/processors.test.ts b/test/processors.test.ts index 7e3ada8..edcba59 100644 --- a/test/processors.test.ts +++ b/test/processors.test.ts @@ -25,7 +25,6 @@ describe("test existing processors", () => { js:rescReader . `; const baseIRI = process.cwd() + "/config.ttl"; - console.log(baseIRI); const source: Source = { value, @@ -67,7 +66,6 @@ describe("test existing processors", () => { js:sendWriter . `; const baseIRI = process.cwd() + "/config.ttl"; - console.log(baseIRI); const source: Source = { value, @@ -114,7 +112,6 @@ describe("test existing processors", () => { js:sendWriter . `; const baseIRI = process.cwd() + "/config.ttl"; - console.log(baseIRI); const source: Source = { value, @@ -178,7 +175,6 @@ describe("test existing processors", () => { js:output . `; const baseIRI = process.cwd() + "/config.ttl"; - console.log(baseIRI); const source: Source = { value, @@ -197,11 +193,8 @@ describe("test existing processors", () => { const argss = extractSteps(proc!, quads, config); expect(argss.length).toBe(1); expect(argss[0].length).toBe(2); - console.log(argss); const [[reader, writer]] = argss; - console.log(reader.ty.value); - console.log(writer.ty.value); expect(reader).toBeInstanceOf(Object); expect(reader.config.channel).toBeDefined();