@link-assistant/web-capture 1.11.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @link-assistant/web-capture
2
2
 
3
+ ## 1.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-release unreleased changes
8
+
3
9
  ## 1.11.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/web-capture",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "CLI and microservice to render web pages as HTML, Markdown, or PNG",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -76,6 +76,25 @@ describe('search module (#130)', () => {
76
76
  });
77
77
  });
78
78
 
79
+ it('keeps URL construction and response parsing transport-independent', () => {
80
+ const sourceUrl = buildSearchUrl('wikipedia', 'formal ai', 1);
81
+ const { results } = parseSearchResults('wikipedia', WIKI_JSON, {
82
+ limit: 1,
83
+ });
84
+
85
+ expect(sourceUrl).toBe(
86
+ 'https://en.wikipedia.org/w/rest.php/v1/search/page?q=formal%20ai&limit=1'
87
+ );
88
+ expect(results).toEqual([
89
+ {
90
+ rank: 1,
91
+ title: 'Formal methods',
92
+ url: 'https://en.wikipedia.org/wiki/Formal_methods',
93
+ snippet: 'the study of formal',
94
+ },
95
+ ]);
96
+ });
97
+
79
98
  describe('parseSearchResults', () => {
80
99
  it('normalizes Wikipedia REST JSON and strips markup', () => {
81
100
  const { results } = parseSearchResults('wikipedia', WIKI_JSON, {