Git Product home page Git Product logo

fixtures-server's Introduction

fixtures-server

Fixtures server for browser & language agnostic octokit testing

Test

The Octokit Fixtures Server is proxies requests to the mocked routes provided by @octokit/fixtures.

Usage

  1. Load a fixture. All folder names at @octokit/fixtures/scenarios/api.github.com are valid values for scenario.

    curl -XPOST -H'Content-Type: application/json' http://localhost:3000/fixtures -d '{"scenario": "get-repository"}'
    

    The response looks something like this

    {
      "id": "fixturesid123",
      "url": "http://localhost:3000/api.github.com/fixturesid123/api.github.com/fixturesid123"
    }
  2. Send a request to the returned url as if it was https://api.github.com.

    curl -H'Authorization: token 0000000000000000000000000000000000000001' -H'Accept: application/vnd.github.v3+json' http://localhost:3000/api.github.com/fixturesid123/repos/octokit-fixture-org/hello-world
    

After that request the fixture is "consumed". That allows for different responses for the same requests based on order.

If you want to load custom fixtures, you'll have to use @octokit/fixtures-server as standalone server or as as express middleware.

Standalone Server

Download binary for your os from the latest release.

Alternatively, you can also install @octokit/fixtures-server as a global npm package, if you prefer that:

npm install --global @octokit/fixtures-server

By default the server runs at http://localhost:3000

octokit-fixtures-server

Options

CLI option ENV variable default description
--port PORT 3000 Server port number
--fixtures-url FIXTURES_URL 'http://localhost:<port>' URL to handle fixture requests (This helps with continuous deployments)
--log-level LOG_LEVEL 'info' One of 'debug', 'info', 'warn', 'error', 'silent'
--ttl TTL 60000 Expiration time for loaded fixtures in ms
--fixtures FIXTURES 'node_modules/@octokit/fixtures/scenarios/**/normalized-fixture.json' glob path to load JSON fixture files recorded with nock. Make sure to wrap the value with quotes, e.g. --fixtures='./scenarios/*.json'

Express Middleware

const express = require("express");
const app = express();

const fixturesServer = require("@octokit/fixtures-server");
app.use(
  fixturesServer({
    fixtures: {
      "my-scenario": require("./scenarios/my-scenario.json"),
    },
  }),
);

app.listen(3000);

Options

Option Default Description
fixturesUrl 'http://localhost:<port>' URL to handle fixture requests (This helps with continuous deployments)
logLevel 'info' One of 'debug', 'info', 'warn', 'error', 'silent'
ttl 60000 Expiration time (time to live) for loaded fixtures in ms
fixtures fixtures from @octokit/fixtures/scenarios/api.github.com Object with keys being the scenario names and values being the fixtures arrays

License

MIT

fixtures-server's People

Contributors

aarondewes avatar benoittgt avatar chizr avatar dependabot[bot] avatar gr2m avatar greenkeeper[bot] avatar jsoref avatar kfcampbell avatar martinb3 avatar nickfloyd avatar octokitbot avatar oscard0m avatar renovate[bot] avatar wolfy1339 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fixtures-server's Issues

Dependency Dashboard

This issue contains a list of Renovate updates and their statuses.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to ignore the schedule.

  • fix(deps): lock file maintenance

  • Check this box to trigger a request for Renovate to run again on this repository

An in-range update of yargs is breaking the build 🚨

The dependency yargs was updated from 13.2.2 to 13.2.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

yargs is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 14 commits.

  • a6e67f1 chore(release): 13.2.4
  • fc13476 chore: update standard-verison dependency
  • bf46813 fix(i18n): rename unclear 'implication failed' to 'missing dependent arguments' (#1317)
  • a3a5d05 docs: fix a broken link to MS Terminology Search (#1341)
  • b4f8018 build: add .versionrc that hides test/build
  • 0c39183 chore(release): 13.2.3
  • 08e0746 chore: update deps (#1340)
  • 843e939 docs: make --no- boolean prefix easier to find in the docs (#1338)
  • 84cac07 docs: restore removed changelog of v13.2.0 (#1337)
  • b20db65 fix(deps): upgrade cliui for compatibility with latest chalk. (#1330)
  • c294d1b test: accept differently formatted output (#1327)
  • ac3f10c chore: move .hbs templates into .js to facilitate webpacking (#1320)
  • 0295132 fix: address issues with dutch translation (#1316)
  • 9f2468e doc: clarify parserConfiguration object structure (#1309)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @octokit/fixtures is breaking the build 🚨

☝️ Greenkeeper’s updated Terms of Service will come into effect on April 6th, 2018.

Version 7.1.0 of @octokit/fixtures was just published.

Branch Build failing 🚨
Dependency @octokit/fixtures
Current Version 7.0.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

@octokit/fixtures is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v7.1.0

7.1.0 (2018-02-24)

Bug Fixes

  • don’t bump fixture entity ID for previously calculated entity IDs (1464607)
  • normalize: last-modified Header (aa5f062)
  • normalize: don’t set Content-Length: 0 Header for empty response (7e0326e)
  • normalize: get redirect URL from location header (01640ac)

Features

  • normalization: archive (6fe9ca6)
  • normalization: async normalization methods (ad0b356)
  • scenario: get archive (0915d8e)
Commits

The new version differs by 11 commits.

  • ac427af test(normalization): adapt for async normalization function
  • 0915d8e feat(scenario): get archive
  • f71c563 build(package): get-stream, gunzip-maybe, into-stream, tar-stream
  • 6fe9ca6 feat(normalization): archive
  • af653a2 build(fixtures): updated normalized fixtures
  • 01640ac fix(normalize): get redirect URL from location header
  • 7e0326e fix(normalize): don’t set Content-Length: 0 Header for empty response
  • aa5f062 fix(normalize): last-modified Header
  • 1464607 fix: don’t bump fixture entity ID for previously calculated entity IDs
  • ad0b356 feat(normalization): async normalization methods
  • 2b03562 chore(package): update axios to version 0.18.0

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of supertest is breaking the build 🚨

Version 3.3.0 of supertest was just published.

Branch Build failing 🚨
Dependency supertest
Current Version 3.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

supertest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes v3.3.0

#509 - Fix #486, bug in _assertBody, switch to deepStrictEqual (thanks @mikelax)
#510 - Refactor test files to use const/let (thanks @rimiti)

Commits

The new version differs by 10 commits.

  • e910e85 chore: Prepare for v3.3.0 release.
  • bd864de Merge pull request #511 from visionmedia/bugfix-486-equal
  • 101fbf5 Merge branch 'master' into bugfix-486-equal
  • 04230bb Merge pull request #510 from visionmedia/refact-const-let
  • 510a7ae bugfix: 486 Change method to use deepStrictEqual. (#509)
  • 913150d chore(.editorconfig) [*.md] block removed
  • 82e0828 refact(test/supertest.js) vars replaced by const and let
  • 5443136 chore(.editorconfig) configuration file created
  • 7233ba6 chore(.eslintrc) parserOptions option added to use es6
  • 322ebf6 bugfix: 486 Change method to use deepStrictEqual.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of supertest is breaking the build 🚨

The devDependency supertest was updated from 3.3.0 to 3.4.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

supertest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v3.4.0
  • PR-532 - Packages updated, pipeline more explicit, documentation updated (thanks @rimiti)
  • PR-517 - Documentation updated (thanks @oprogramador)
  • PR-513 - Use more robust Array instance check (thanks @rubendg)
Commits

The new version differs by 14 commits.

  • 5640ac9 3.4.0
  • 60f8a9e Merge pull request #532 from visionmedia/v3.4.0
  • 43bfae1 doc(History.md) changelog updated
  • fc1568d doc(README.md) cookie example added
  • 3192d96 chore(package-lock.json) file updated
  • b3d271f chore(package.json) blocks reorganized, nock removed
  • aeae0f3 chore(.travis.yml) pipeline more explicit
  • 53feddc chore(test/supertest.js) obscure test removed
  • 50c59d6 Merge pull request #519 from oprogramador/patch-3
  • 6ca3897 Merge pull request #517 from oprogramador/patch-2
  • 0146d81 auth info in README
  • d853b37 fix typo in README
  • 8158979 Merge pull request #513 from rubendg/use-isarray
  • 550613b Use more robust Array instance check

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of semantic-release is breaking the build 🚨

Version 15.9.2 of semantic-release was just published.

Branch Build failing 🚨
Dependency semantic-release
Current Version 15.9.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes v15.9.2

15.9.2 (2018-07-30)

Bug Fixes

  • also hide sensitive info when loggin from cli.js (43d0646)
Commits

The new version differs by 1 commits.

  • 43d0646 fix: also hide sensitive info when loggin from cli.js

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

false negatives due to conflicts with loaded fixtures

All mocks loaded with nock are stored globally. When loading the same fixture twice, nock cannot differentiate between the two instances as they use the same domain as scope.

To workaround that we can dynamically override the scope when loading the fixtures as well as in the proxy to contain the unique fixture id

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: package.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: author, Invalid configuration option: bin, Invalid configuration option: files, Invalid configuration option: keywords, Invalid configuration option: license, Invalid configuration option: main, Invalid configuration option: name, Invalid configuration option: now, Invalid configuration option: packageRules[0].@octokit/fixtures, Invalid configuration option: packageRules[0].cachimo, Invalid configuration option: packageRules[0].console-log-level, Invalid configuration option: packageRules[0].cors, Invalid configuration option: packageRules[0].express, Invalid configuration option: packageRules[0].glob, Invalid configuration option: packageRules[0].http-proxy-middleware, Invalid configuration option: packageRules[0].lodash, Invalid configuration option: packageRules[0].yargs, Invalid configuration option: packageRules[1].axios, Invalid configuration option: packageRules[1].pkg, Invalid configuration option: packageRules[1].prettier, Invalid configuration option: packageRules[1].proxyquire, Invalid configuration option: packageRules[1].semantic-release, Invalid configuration option: packageRules[1].supertest, Invalid configuration option: packageRules[1].tap, Invalid configuration option: pkg, Invalid configuration option: publishConfig, Invalid configuration option: release, Invalid configuration option: renovate, Invalid configuration option: scripts, Invalid configuration option: version

An in-range update of semantic-release is breaking the build 🚨

Version 15.9.12 of semantic-release was just published.

Branch Build failing 🚨
Dependency semantic-release
Current Version 15.9.11
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes v15.9.12

15.9.12 (2018-08-27)

Bug Fixes

  • hide sensitive data in relesae notes and fail/success plugin params (dffe148)
Commits

The new version differs by 1 commits.

  • dffe148 fix: hide sensitive data in relesae notes and fail/success plugin params

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.