Skip to content

gatsby-link: add withPrefix to index.d.ts #2887

@codekiln

Description

@codekiln

Recently the gatsby-link withPrefix helper was added. It would be helpful to have this also added to gatsby-link's index.d.ts, so this function could be used in typescript.

-------------- contributing side note --------------

In following the contributing guidelines, I downloaded a latest forked Gatsby source, ran yarn run bootstrap, and then ran tests locally before making modifications, which turned up eight tests failures out of the box. I see that some recent PR test run jobs #4773.1 and #4773.2 have also exhibited the same failures on Travis. Are these test failures common? If so, what is the associated issue and the recommended procedure for resolving them?

Summary of all failing tests
 FAIL  packages/gatsby/cache-dir/__tests__/loader.js
  ● Loader › You can enqueue paths

    TypeError: loader.empty is not a function
      
      at Object.beforeEach (packages/gatsby/cache-dir/__tests__/loader.js:5:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › You can enqueue paths

    TypeError: loader.enqueue is not a function
      
      at Object.test (packages/gatsby/cache-dir/__tests__/loader.js:21:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › FIFO by default

    TypeError: loader.empty is not a function
      
      at Object.beforeEach (packages/gatsby/cache-dir/__tests__/loader.js:5:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › FIFO by default

    TypeError: loader.enqueue is not a function
      
      at Object.test (packages/gatsby/cache-dir/__tests__/loader.js:27:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › Paths enqueued more times are prioritized

    TypeError: loader.empty is not a function
      
      at Object.beforeEach (packages/gatsby/cache-dir/__tests__/loader.js:5:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › Paths enqueued more times are prioritized

    TypeError: loader.enqueue is not a function
      
      at Object.test (packages/gatsby/cache-dir/__tests__/loader.js:33:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › Paths are only added once to the queue

    TypeError: loader.empty is not a function
      
      at Object.beforeEach (packages/gatsby/cache-dir/__tests__/loader.js:5:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › Paths are only added once to the queue

    TypeError: loader.enqueue is not a function
      
      at Object.test (packages/gatsby/cache-dir/__tests__/loader.js:40:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › You can't enqueue paths that don't exist

    TypeError: loader.empty is not a function
      
      at Object.beforeEach (packages/gatsby/cache-dir/__tests__/loader.js:5:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › You can't enqueue paths that don't exist

    TypeError: loader.enqueue is not a function
      
      at Object.test (packages/gatsby/cache-dir/__tests__/loader.js:50:19)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › You can dequeue a path

    TypeError: loader.empty is not a function
      
      at Object.beforeEach (packages/gatsby/cache-dir/__tests__/loader.js:5:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › You can dequeue a path

    TypeError: loader.enqueue is not a function
      
      at Object.test (packages/gatsby/cache-dir/__tests__/loader.js:54:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › You can get the order of a path

    TypeError: loader.empty is not a function
      
      at Object.beforeEach (packages/gatsby/cache-dir/__tests__/loader.js:5:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › You can get the order of a path

    TypeError: loader.enqueue is not a function
      
      at Object.test (packages/gatsby/cache-dir/__tests__/loader.js:59:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › Resources are ordered correctly by count

    TypeError: loader.empty is not a function
      
      at Object.beforeEach (packages/gatsby/cache-dir/__tests__/loader.js:5:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

  ● Loader › Resources are ordered correctly by count

    TypeError: loader.enqueue is not a function
      
      at Object.test (packages/gatsby/cache-dir/__tests__/loader.js:65:12)
          at Promise (<anonymous>)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions