Skip to content

Tests may be broken on Windows #137

Description

@felicitymay

When I run tests locally using npm test on master:

I get the following output:
$ npm test
> help.github.com@0.0.1 test C:\2_Semmle\Repositories\help-docs
> jest && standard && npm run check-deps
FAIL tests/unit/products.js (31.288 s)
● products module › every product is valid
Custom message:
{
"product": {
"id": "github",
"name": "GitHub.com",
"href": "/github",
"dir": "content/github",
"toc": "content\\github\\index.md",
"wip": false,
"hasEnterpriseUserVersions": true
},
"errors": [
{
"attribute": "pattern",
"property": "toc",
"expected": "^content/.*?index.md$",
"actual": "content\\github\\index.md",
"message": "invalid input"
}
]
}
expect(received).toBe(expected) // Object.is equality
Expected: true
Received: false
14 | const { valid, errors } = revalidator.validate(product, schema)
15 | const expectation = JSON.stringify({ product, errors }, null, 2)
> 16 | expect(valid, expectation).toBe(true)
| ^
17 | })
18 | })
19 | })
at forEach (tests/unit/products.js:16:34)
at Array.forEach (<anonymous>)
at Object.<anonymous> (tests/unit/products.js:13:29)
PASS tests/routing/deprecated-enterprise-versions.js (33.404 s)
PASS tests/unit/toc-links.js (43.006 s)
FAIL tests/rendering/server.js (57.626 s)
● stylesheets › compiles and sets the right content-type header
expect(received).toBe(expected) // Object.is equality
Expected: 200
Received: 301
740 | it('compiles and sets the right content-type header', async () => {
741 | const res = await get('/dist/index.css')
> 742 | expect(res.statusCode).toBe(200)
| ^
743 | expect(res.headers['content-type']).toBe('text/css; charset=UTF-8')
744 | })
745 | })
at Object.<anonymous> (tests/rendering/server.js:742:28)
● client-side JavaScript bundle › returns a 200 response
expect(received).toBe(expected) // Object.is equality
Expected: 200
Received: 301
753 |
754 | it('returns a 200 response', async () => {
> 755 | expect(res.statusCode).toBe(200)
| ^
756 | })
757 |
758 | it('sets the right content-type header', async () => {
at Object.<anonymous> (tests/rendering/server.js:755:28)
● client-side JavaScript bundle › sets the right content-type header
expect(received).toBe(expected) // Object.is equality
Expected: "application/javascript; charset=UTF-8"
Received: "text/plain; charset=utf-8"
757 |
758 | it('sets the right content-type header', async () => {
> 759 | expect(res.headers['content-type']).toBe('application/javascript; charset=UTF-8')
| ^
760 | })
761 |
762 | // TODO: configure webpack to create production bundle in the test env
at Object.<anonymous> (tests/rendering/server.js:759:41)
PASS tests/rendering/header.js (28.09 s)
PASS tests/content/site-tree.js (29.112 s)
PASS tests/rendering/breadcrumbs.js (31.095 s)
FAIL tests/content/article-links.js (82.541 s)
● article links › in "content\actions\hosting-your-own-runners\monitoring-and-troubleshooting-self-hosted-runners.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [962]: Starting
- [962]: Started
- [962]: Started
- [962]: √
- [962]: 2020-02-11
- [962]: 2020-02-11
- [962]: 2020-02-11
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 7
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\enterprise\admin\enterprise-management\migrating-from-github-enterprise-1110x-to-2123.md" › URLs must not contain a hard-coded version number
Custom message:
Found article links with hard-coded version numbers:
- [Upgrading to the latest release](/enterprise/11.10.340/admin/articles/upgrading-to-the-latest-release/)
- [Provisioning and Installation](/enterprise/2.1/admin/guides/installation/provisioning-and-installation/)
- [Provisioning and Installation](/enterprise/2.1/admin/guides/installation/provisioning-and-installation/)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 3
180 |
181 | const errorMessage = formatLinkError(versionLinkErrorText, matches)
> 182 | expect(matches.length, errorMessage).toBe(0)
| ^
183 | })
184 |
185 | test('URLs must not contain a hard-coded domain name', async () => {
at Object.<anonymous> (tests/content/article-links.js:182:46)
● article links › in "content\enterprise\admin\user-management\configuring-email-for-notifications.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [13210]: connect
- [13210]: 51DC9163323:
- [13216]: 51DC9163323:
- [17250]: 51DC9163323:
- [13217]: 51DC9163323:
- [17250]: 51DC9163323:
- [13210]: disconnect
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 7
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\building-a-strong-community\editing-wiki-content.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [Link Text](full-URL-of-wiki-page)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 1
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\building-a-strong-community\manually-creating-a-single-issue-template-for-your-repository.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [DATE]: [FEATURE
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 1
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\enforcing-best-practices-with-github-policies\constraints.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [a-z]([a-z]|-)
- [a-z]([a-z]|-)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 2
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\enforcing-best-practices-with-github-policies\overview.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [A-Z]([a-z]|-)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 1
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\finding-security-vulnerabilities-and-errors-in-your-code\sarif-support-for-code-scanning.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [here](1)
- [here](2)
- [ruleIndex](1)
- [ruleID](2)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 4
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\rest\overview\libraries.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [pithub-github] ([CPAN][pithub-cpan])
- [net-github-github] ([CPAN][net-github-cpan])
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 2
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "data\reusables\repositories\relative-links.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [Contribution guidelines for this project](docs/CONTRIBUTING.md)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 1
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
(node:7752) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
PASS tests/routing/top-developer-site-path-redirects.js (29.88 s)
PASS tests/routing/redirects.js (29.404 s)
PASS tests/content/site-data.js (33.601 s)
PASS tests/rendering/page-titles.js (30.475 s)
PASS tests/rendering/sidebar.js (31.603 s)
PASS tests/routing/developer-site-redirects.js (28.341 s)
PASS tests/rendering/footer.js (27.494 s)
PASS tests/content/graphql.js (29.668 s)
PASS tests/rendering/curated-homepage-links.js (27.603 s)
PASS tests/content/webhooks.js (26.777 s)
PASS tests/content/featured-links.js (27.765 s)
PASS tests/routing/language-code-redirects.js (32.3 s)
PASS tests/links-and-images/links-and-images.js (150.636 s)
PASS tests/rendering/head.js (27.813 s)
PASS tests/rendering/rest.js (26.164 s)
PASS tests/unit/pages.js (18.399 s)
PASS tests/content/glossary.js (11.873 s)
PASS tests/content/site-data-references.js (14.73 s)
PASS tests/content/crowdin-config.js (10.643 s)
PASS tests/unit/liquid.js
PASS tests/unit/page.js
PASS tests/content/liquid-line-breaks.js (24.988 s)
PASS tests/unit/find-page.js
PASS tests/rendering/robots-txt.js
PASS tests/unit/algolia/parse-page-sections-into-records.js
PASS tests/content/remove-liquid-statements.js
PASS tests/routing/middleware/redirects/help-to-docs.js
PASS tests/unit/enterprise-versions.js
PASS tests/unit/permalink.js
PASS tests/content/gitignore.js
PASS tests/meta/orphan-tests.js
PASS tests/unit/languages.js
PASS tests/unit/product-names.js
PASS tests/content/algolia-search.js
FAIL tests/content/category-pages.js (6.286 s)
● category pages › category index "github\getting-started-with-github\index.md" › contains all expected articles
Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
at mapper (node_modules/jest-jasmine2/build/queueRunner.js:29:45)
● category pages › category index "github\getting-started-with-github\index.md" › does not any unexpected articles
Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
at mapper (node_modules/jest-jasmine2/build/queueRunner.js:29:45)
PASS tests/unit/liquid-helpers.js (10.572 s)
PASS tests/links-and-images/developer-links-and-images.js (736.398 s)
A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --runInBand --detectOpenHandles to find leaks.
Summary of all failing tests
FAIL tests/unit/products.js (31.288 s)
● products module › every product is valid
Custom message:
{
"product": {
"id": "github",
"name": "GitHub.com",
"href": "/github",
"dir": "content/github",
"toc": "content\\github\\index.md",
"wip": false,
"hasEnterpriseUserVersions": true
},
"errors": [
{
"attribute": "pattern",
"property": "toc",
"expected": "^content/.*?index.md$",
"actual": "content\\github\\index.md",
"message": "invalid input"
}
]
}
expect(received).toBe(expected) // Object.is equality
Expected: true
Received: false
14 | const { valid, errors } = revalidator.validate(product, schema)
15 | const expectation = JSON.stringify({ product, errors }, null, 2)
> 16 | expect(valid, expectation).toBe(true)
| ^
17 | })
18 | })
19 | })
at forEach (tests/unit/products.js:16:34)
at Array.forEach (<anonymous>)
at Object.<anonymous> (tests/unit/products.js:13:29)
FAIL tests/rendering/server.js (57.626 s)
● stylesheets › compiles and sets the right content-type header
expect(received).toBe(expected) // Object.is equality
Expected: 200
Received: 301
740 | it('compiles and sets the right content-type header', async () => {
741 | const res = await get('/dist/index.css')
> 742 | expect(res.statusCode).toBe(200)
| ^
743 | expect(res.headers['content-type']).toBe('text/css; charset=UTF-8')
744 | })
745 | })
at Object.<anonymous> (tests/rendering/server.js:742:28)
● client-side JavaScript bundle › returns a 200 response
expect(received).toBe(expected) // Object.is equality
Expected: 200
Received: 301
753 |
754 | it('returns a 200 response', async () => {
> 755 | expect(res.statusCode).toBe(200)
| ^
756 | })
757 |
758 | it('sets the right content-type header', async () => {
at Object.<anonymous> (tests/rendering/server.js:755:28)
● client-side JavaScript bundle › sets the right content-type header
expect(received).toBe(expected) // Object.is equality
Expected: "application/javascript; charset=UTF-8"
Received: "text/plain; charset=utf-8"
757 |
758 | it('sets the right content-type header', async () => {
> 759 | expect(res.headers['content-type']).toBe('application/javascript; charset=UTF-8')
| ^
760 | })
761 |
762 | // TODO: configure webpack to create production bundle in the test env
at Object.<anonymous> (tests/rendering/server.js:759:41)
FAIL tests/content/article-links.js (82.541 s)
● article links › in "content\actions\hosting-your-own-runners\monitoring-and-troubleshooting-self-hosted-runners.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [962]: Starting
- [962]: Started
- [962]: Started
- [962]: √
- [962]: 2020-02-11
- [962]: 2020-02-11
- [962]: 2020-02-11
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 7
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\enterprise\admin\enterprise-management\migrating-from-github-enterprise-1110x-to-2123.md" › URLs must not contain a hard-coded version number
Custom message:
Found article links with hard-coded version numbers:
- [Upgrading to the latest release](/enterprise/11.10.340/admin/articles/upgrading-to-the-latest-release/)
- [Provisioning and Installation](/enterprise/2.1/admin/guides/installation/provisioning-and-installation/)
- [Provisioning and Installation](/enterprise/2.1/admin/guides/installation/provisioning-and-installation/)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 3
180 |
181 | const errorMessage = formatLinkError(versionLinkErrorText, matches)
> 182 | expect(matches.length, errorMessage).toBe(0)
| ^
183 | })
184 |
185 | test('URLs must not contain a hard-coded domain name', async () => {
at Object.<anonymous> (tests/content/article-links.js:182:46)
● article links › in "content\enterprise\admin\user-management\configuring-email-for-notifications.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [13210]: connect
- [13210]: 51DC9163323:
- [13216]: 51DC9163323:
- [17250]: 51DC9163323:
- [13217]: 51DC9163323:
- [17250]: 51DC9163323:
- [13210]: disconnect
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 7
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\building-a-strong-community\editing-wiki-content.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [Link Text](full-URL-of-wiki-page)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 1
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\building-a-strong-community\manually-creating-a-single-issue-template-for-your-repository.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [DATE]: [FEATURE
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 1
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\enforcing-best-practices-with-github-policies\constraints.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [a-z]([a-z]|-)
- [a-z]([a-z]|-)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 2
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\enforcing-best-practices-with-github-policies\overview.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [A-Z]([a-z]|-)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 1
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\github\finding-security-vulnerabilities-and-errors-in-your-code\sarif-support-for-code-scanning.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [here](1)
- [here](2)
- [ruleIndex](1)
- [ruleID](2)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 4
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "content\rest\overview\libraries.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [pithub-github] ([CPAN][pithub-cpan])
- [net-github-github] ([CPAN][net-github-cpan])
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 2
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
● article links › in "data\reusables\repositories\relative-links.md" › relative URLs must start with "/"
Custom message:
Found unexpected relative article links:
- [Contribution guidelines for this project](docs/CONTRIBUTING.md)
expect(received).toBe(expected) // Object.is equality
Expected: 0
Received: 1
159 |
160 | const errorMessage = formatLinkError(relativeArticleLinkErrorText, matches)
> 161 | expect(matches.length, errorMessage).toBe(0)
| ^
162 | })
163 |
164 | test('URLs must not contain a hard-coded language code', async () => {
at Object.<anonymous> (tests/content/article-links.js:161:46)
FAIL tests/content/category-pages.js (6.286 s)
● category pages › category index "github\getting-started-with-github\index.md" › contains all expected articles
Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
at mapper (node_modules/jest-jasmine2/build/queueRunner.js:29:45)
● category pages › category index "github\getting-started-with-github\index.md" › does not any unexpected articles
Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
at mapper (node_modules/jest-jasmine2/build/queueRunner.js:29:45)
Test Suites: 4 failed, 41 passed, 45 total
Tests: 16 failed, 7 skipped, 2 todo, 14879 passed, 14904 total
Snapshots: 0 total
Time: 741.238 s, estimated 781 s
Ran all test suites.
npm ERR! Test failed. See above for more details.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineeringWill involve Docs Engineering

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions