Code Monkey home page Code Monkey logo

mirage's Introduction

⚠️ DEPRECATED ⚠️

In order to make BigTest development faster and friction free, we've consolidated all of our individual projects into a single repository on the Frontside Organization. We'd love to see you there!

note: the last release from this repository was 0.0.1

Mirage Server

A client-side server to develop, test and prototype your app.

Note: This repository has been archived in favor of https://github.com/miragejs/server Documentation and tutorials at https://miragejs.com/docs

This project is a plain vanilla javascript extraction of the ember-cli-mirage project. It can be used inside of any framework, including React. The goal is for it to be eventually used upstream by Ember mirage proper.

Usage

import Mirage, { Factory } from '@bigtest/mirage';

let server = new Mirage({
  environment: 'test',
  factories: {
    address: Factory
  }
});

// do some stuff with the server.

// stop intercepting requests
server.shutdown()

Development

Test suite is running in QUnit and Karma.

$ yarn
$ yarn start // karma server
$ yarn test // single run

mirage's People

Contributors

2468ben avatar abuiles avatar alecho avatar anulman avatar azdaroth avatar bantic avatar bekzod avatar blimmer avatar cibernox avatar cowboyd avatar dfreeman avatar dhaulagiri avatar dustinfarris avatar ef4 avatar g-cassie avatar heroiceric avatar jherdman avatar lazybensch avatar lolmaus avatar lukemelia avatar mupkoo avatar offirgolan avatar rjschie avatar robdel12 avatar rwjblue avatar samselikoff avatar seanpdoyle avatar trabus avatar turbo87 avatar willrax avatar

Stargazers

 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

mirage's Issues

Configure ES modules correctly

It is common in a webpack environment when using babel to not transform modules within the node_modules directory. Our package's "module" field points directly to the src files, which are typically compiled with @babel/preset-env. When babel is configured to not compile our packages within node_modules, bundles that use our packages can end up broken.

This can be seen in @bigtest/interaction tests by removing the (!?/@bigtest) regexp within the babel-loader exclude option in the karma.config.js file. This causes the package to fail to properly extend the convergence class and thereby causes every test to fail.

(moved from thefrontside/bigtest#55)

Update Mirage devDependencies

I noticed that mirage is using babel-* dependencies. The rest of this repo uses babel 7 (now under the babel org @babel/*). Babel 7 is required for module resolution to work correctly in yarn workspaces / monorepos. It also uses babel-preset-es2016 which has been deprecated in favor of @babel/env.

Mirage also uses an older karma. The current version is 2.0.0 while mirage specifies 1.7.0. This is only an issue because when we yarn we will end up with multiple versions of karma. They will be correctly placed in the corresponding package's node_modules, but having all packages utilize the same versions allows us to hoist dependencies into the root node_modules directory.

(moved from thefrontside/bigtest#45)

Example for GET request

Hey,

Is possible to give an example implementation of adding a get request to the server in react similar to this.get('/users/:id', 'user'); in Ember. Also it would be helpful if you can tell me where should my mirage folder reside. Please note this is not for testing purpose. I want to deploy a site with fake data(similar to ember-mirage)

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.