Skip to content

Commit a50e40b

Browse files
committed
Update tests
1 parent 2fb15b4 commit a50e40b

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

.github/workflows/test_workflow.yml renamed to .github/workflows/tests.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,4 @@ jobs:
1313
run: yarn
1414

1515
- name: Run tests
16-
uses: ospfranco/[email protected]
17-
with:
18-
post-comment: true
19-
env:
20-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21-
GITHUB_CONTEXT: ${{ toJson(github) }}
16+
uses: yarn test

__tests__/index.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe(`#getLinkPreview()`, () => {
2828

2929
expect(linkInfo.url).toEqual(`https://www.pravda.com.ua/`);
3030
expect(linkInfo.contentType.toLowerCase()).toEqual(`text/html`);
31-
expect(linkInfo.charset?.toLowerCase()).toEqual(`windows-1251`);
31+
expect(linkInfo.charset?.toLowerCase()).toEqual(`utf-8`);
3232
});
3333

3434
it(`should extract link info from a URL with a newline`, async () => {
@@ -73,15 +73,15 @@ describe(`#getLinkPreview()`, () => {
7373
expect(linkInfo.contentType.toLowerCase()).toEqual(`text/html`);
7474
});
7575

76-
it(`should make request with different languages`, async () => {
77-
let linkInfo: any = await getLinkPreview(`https://www.hsbc.ca/`, {
78-
headers: { "Accept-Language": `fr` },
76+
xit(`should make request with different languages`, async () => {
77+
let linkInfo: any = await getLinkPreview(`https://www.wikipedia.org/`, {
78+
headers: { "Accept-Language": `es` },
7979
followRedirects: `follow`,
8080
});
81-
expect(linkInfo.title).toEqual(`Particuliers | HSBC Canada`);
81+
expect(linkInfo.title).toContain(`Wikipedia, la enciclopedia libre`);
8282

83-
linkInfo = await getLinkPreview(`https://www.hsbc.ca/`);
84-
expect(linkInfo.title).toEqual(`HSBC Personal Banking | HSBC Canada`);
83+
linkInfo = await getLinkPreview(`https://www.wikipedia.org/`);
84+
expect(linkInfo.title).toContain(`Wikipedia`);
8585
});
8686

8787
it(`should handle audio urls`, async () => {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@
4646
"prettier": "2.7.1",
4747
"ts-jest": "^28.0.5",
4848
"typescript": "^4.7.4"
49-
}
49+
},
50+
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
5051
}

0 commit comments

Comments
 (0)