Skip to content

tests failing on Mac #223

Closed
Closed
@jeffmcaffer

Description

@jeffmcaffer

What is the current behavior?

I cloned the repo, did npm install and npm test and got a number of failures shown below.

Note this was with Node 12.18.3 (npm 6.14.6) on Mac OS 10.15.7

``` ~/git/docs$ npm test

docs.github.com@ test /Users/jeffmcaffer/git/docs
jest && standard && npm run check-deps

PASS tests/content/remove-liquid-statements.js
PASS tests/unit/page.js (5.381 s)
PASS tests/content/category-pages.js (5.877 s)
PASS tests/routing/deprecated-enterprise-versions.js (39.664 s)
PASS tests/routing/redirects.js (43.153 s)
PASS tests/rendering/breadcrumbs.js (34.25 s)
PASS tests/routing/developer-site-redirects.js (50.398 s)
FAIL tests/rendering/server.js (56.332 s)
● static assets › fonts

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 404

  567 | describe('static assets', () => {
  568 |   test('fonts', async () => {
> 569 |     expect((await get('/dist/fonts/Inter-Medium.woff')).statusCode).toBe(200)
      |                                                                     ^
  570 |     expect((await get('/dist/fonts/Inter-Regular.woff')).statusCode).toBe(200)
  571 |   })
  572 | })

  at Object.<anonymous> (tests/rendering/server.js:569:69)
      at runMicrotasks (<anonymous>)

● stylesheets › compiles and sets the right content-type header

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 404

  665 |   it('compiles and sets the right content-type header', async () => {
  666 |     const res = await get('/dist/index.css')
> 667 |     expect(res.statusCode).toBe(200)
      |                            ^
  668 |     expect(res.headers['content-type']).toBe('text/css; charset=UTF-8')
  669 |   })
  670 | })

  at Object.<anonymous> (tests/rendering/server.js:667:28)
      at runMicrotasks (<anonymous>)

● client-side JavaScript bundle › returns a 200 response

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 404

  678 | 
  679 |   it('returns a 200 response', async () => {
> 680 |     expect(res.statusCode).toBe(200)
      |                            ^
  681 |   })
  682 | 
  683 |   it('sets the right content-type header', async () => {

  at Object.<anonymous> (tests/rendering/server.js:680:28)
      at runMicrotasks (<anonymous>)

● 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/html; charset=utf-8"

  682 | 
  683 |   it('sets the right content-type header', async () => {
> 684 |     expect(res.headers['content-type']).toBe('application/javascript; charset=UTF-8')
      |                                         ^
  685 |   })
  686 | 
  687 |   // TODO: configure webpack to create production bundle in the test env

  at Object.<anonymous> (tests/rendering/server.js:684:41)
      at runMicrotasks (<anonymous>)

PASS tests/unit/liquid-helpers.js (21.265 s)
PASS tests/rendering/events.js (34.335 s)
● Console

console.log
  data should NOT have additional properties, data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data should have required property 'type', data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data should have required property 'url', data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data.url should match format "uri", data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data should have required property 'vote', data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data.vote should be equal to one of the allowed values, data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data.email should match format "email", data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data.comment should be string, data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data.category should be equal to one of the allowed values, data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data should NOT have additional properties, data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data should NOT have additional properties, data should NOT have additional properties, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data should NOT have additional properties, data should have required property 'test', data should match exactly one schema in oneOf

  at middleware/events.js:24:56

console.log
  data should NOT have additional properties, data.group should be equal to one of the allowed values, data should match exactly one schema in oneOf

  at middleware/events.js:24:56

PASS tests/unit/pages.js (26.201 s)
PASS tests/rendering/robots-txt.js
PASS tests/rendering/header.js (37.275 s)
PASS tests/content/site-data.js (26.117 s)
PASS tests/content/lint-files.js (100.357 s)
PASS tests/content/graphql.js (22.673 s)
PASS tests/content/liquid-line-breaks.js (18.835 s)
PASS tests/unit/permalink.js
PASS tests/rendering/early-access-proxy.js
PASS tests/routing/middleware/redirects/help-to-docs.js
PASS tests/content/featured-links.js (35.996 s)
PASS tests/content/site-tree.js (34.16 s)
PASS tests/content/site-data-references.js (27.327 s)
PASS tests/unit/algolia/parse-page-sections-into-records.js
PASS tests/content/webhooks.js (30.935 s)
PASS tests/content/glossary.js (9.199 s)
PASS tests/unit/hydro.js
PASS tests/unit/products.js (31.765 s)
PASS tests/rendering/early-access-paths.js
PASS tests/rendering/octicon.js
PASS tests/content/algolia-search.js
PASS tests/rendering/rest.js (32.291 s)
PASS tests/unit/find-page.js
PASS tests/rendering/page-titles.js (33.27 s)
PASS tests/unit/liquid.js
PASS tests/unit/versions.js (35.216 s)
PASS tests/unit/enterprise-versions.js
PASS tests/unit/failbot.js
PASS tests/unit/actions-workflows.js
PASS tests/rendering/sidebar.js (36.861 s)
PASS tests/rendering/curated-homepage-links.js (38.831 s)
PASS tests/rendering/head.js (34.839 s)
PASS tests/meta/orphan-tests.js
PASS tests/unit/languages.js
PASS tests/links-and-images/links-and-images.js (128.414 s)
PASS tests/unit/algolia/rank.js
PASS tests/unit/feature-flags.js
PASS tests/unit/product-names.js
PASS tests/content/gitignore.js
PASS tests/content/crowdin-config.js
PASS tests/unit/toc-links.js (41.24 s)
(node:1530) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
PASS tests/routing/language-code-redirects.js (30.538 s)
PASS tests/rendering/footer.js (30.62 s)
PASS tests/rendering/csrf-route.js (25.021 s)
PASS tests/routing/top-developer-site-path-redirects.js (38.56 s)
PASS tests/links-and-images/developer-links-and-images.js (303.602 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/rendering/server.js (56.332 s)
● static assets › fonts

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 404

  567 | describe('static assets', () => {
  568 |   test('fonts', async () => {
> 569 |     expect((await get('/dist/fonts/Inter-Medium.woff')).statusCode).toBe(200)
      |                                                                     ^
  570 |     expect((await get('/dist/fonts/Inter-Regular.woff')).statusCode).toBe(200)
  571 |   })
  572 | })

  at Object.<anonymous> (tests/rendering/server.js:569:69)
      at runMicrotasks (<anonymous>)

● stylesheets › compiles and sets the right content-type header

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 404

  665 |   it('compiles and sets the right content-type header', async () => {
  666 |     const res = await get('/dist/index.css')
> 667 |     expect(res.statusCode).toBe(200)
      |                            ^
  668 |     expect(res.headers['content-type']).toBe('text/css; charset=UTF-8')
  669 |   })
  670 | })

  at Object.<anonymous> (tests/rendering/server.js:667:28)
      at runMicrotasks (<anonymous>)

● client-side JavaScript bundle › returns a 200 response

expect(received).toBe(expected) // Object.is equality

Expected: 200
Received: 404

  678 | 
  679 |   it('returns a 200 response', async () => {
> 680 |     expect(res.statusCode).toBe(200)
      |                            ^
  681 |   })
  682 | 
  683 |   it('sets the right content-type header', async () => {

  at Object.<anonymous> (tests/rendering/server.js:680:28)
      at runMicrotasks (<anonymous>)

● 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/html; charset=utf-8"

  682 | 
  683 |   it('sets the right content-type header', async () => {
> 684 |     expect(res.headers['content-type']).toBe('application/javascript; charset=UTF-8')
      |                                         ^
  685 |   })
  686 | 
  687 |   // TODO: configure webpack to create production bundle in the test env

  at Object.<anonymous> (tests/rendering/server.js:684:41)
      at runMicrotasks (<anonymous>)

Test Suites: 1 failed, 55 passed, 56 total
Tests: 4 failed, 67 skipped, 2 todo, 22825 passed, 22898 total
Snapshots: 0 total
Time: 304.86 s
Ran all test suites.
npm ERR! Test failed. See above for more details.
~/git/docs$ node --version
v12.18.3
~/git/docs$

</details>

cc: @github/docs-engineering 

Metadata

Metadata

Assignees

Labels

engineeringWill involve Docs EngineeringstaleThere is no recent activity on this issue or pull request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions