fusionjs / fusion-test-utils

Migrated to https://github.com/fusionjs/fusionjs
MIT License
5 stars 17 forks source link

Add createRequestContext and createRenderContext functions #182

Closed ganemone closed 6 years ago

ganemone commented 6 years ago

These functions can be useful when trying to test middleware or APIs which rely on a context object. Usage example:

import {createRequestContext, createRenderContext} from 'fusion-test-utils';
const ctx = createRenderContext('/')
const ctx2 = createRequestContext('/', {method: 'POST'});
// ... etc
codecov[bot] commented 6 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@25cbc33). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #182   +/-   ##
=========================================
  Coverage          ?   87.01%           
=========================================
  Files             ?        3           
  Lines             ?       77           
  Branches          ?       14           
=========================================
  Hits              ?       67           
  Misses            ?        8           
  Partials          ?        2
Impacted Files Coverage Δ
src/index.js 70% <ø> (ø)
src/simulate.js 100% <100%> (ø)
src/mock-context.js 96.55% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 25cbc33...ae3bab8. Read the comment docs.

ganemone commented 6 years ago

!merge