Skip to content

Commit a52d7f3

Browse files
committed
fix: updated tests and added lint and fmt and fixed workflow #8
1 parent 50a7c51 commit a52d7f3

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: Test
22

33
on:
44
push:
5-
branches: '**'
6-
tags-ignore: '*'
5+
branches: "**"
6+
tags-ignore: "*"
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
deno-version: [1.11.x]
13+
deno-version: [1.x]
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: Use Deno ${{ matrix.deno-version }}

adapter.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ export default function ({ config, asyncFetch, headers, handleResponse }) {
268268
)
269269
.bichain(
270270
handleRejectedResponse,
271-
(res) => Async.Resolved({ ok: true, results: map(o => ({ok: true, id: o.index._id}), res.items) }),
271+
(res) =>
272+
Async.Resolved({
273+
ok: true,
274+
results: map((o) => ({ ok: true, id: o.index._id }), res.items),
275+
}),
272276
)
273277
.toPromise();
274278
}
@@ -310,10 +314,10 @@ export default function ({ config, asyncFetch, headers, handleResponse }) {
310314
// Success
311315
(res) =>
312316
Async.Resolved(
313-
({
317+
{
314318
ok: true,
315319
matches: pluck("_source", res.hits.hits),
316-
}),
320+
},
317321
),
318322
)
319323
.toPromise();

adapter_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ Deno.test("bulk", async () => {
175175
// bulk operation
176176
stubResponse(200, {
177177
items: [
178-
DOC1,
179-
DOC2,
178+
{ index: { _id: DOC1.id, ...DOC1 } },
179+
{ index: { _id: DOC2.id, ...DOC2 } },
180180
],
181181
});
182182

scripts/hyper.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ import search from "../mod.js";
66
await hyper({
77
app,
88
adapters: [
9-
{ port: "search", plugins: [search({ url: "http://localhost:9200", username: 'admin', password: 'admin' })] },
9+
{
10+
port: "search",
11+
plugins: [
12+
search({
13+
url: "http://localhost:9200",
14+
username: "admin",
15+
password: "admin",
16+
}),
17+
],
18+
},
1019
],
11-
});
20+
});

scripts/test.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
#!/usr/bin/env bash
22

3-
deno lint
4-
deno fmt --check
5-
deno test
3+
deno lint && deno fmt --check && deno test

0 commit comments

Comments
 (0)