How to use the miragejs.RestSerializer.extend function in miragejs

To help you get started, we’ve selected a few miragejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gitlabhq / gitlabhq / spec / frontend_integration / test_helpers / mock_server / index.js View on Github external
export const createMockServerOptions = () => ({
  models: {
    project: Model,
    branch: Model,
    mergeRequest: Model,
    mergeRequestChange: Model,
    mergeRequestVersion: Model,
    file: Model,
    userPermission: Model,
  },
  serializers: {
    application: RestSerializer.extend({
      root: false,
    }),
  },
  seeds(schema) {
    schema.db.loadData({
      files: getRepositoryFiles().map((path) => ({ path })),
      projects: [getProject(), getEmptyProject()],
      branches: [getBranch()],
      mergeRequests: getMergeRequests(),
      mergeRequestChanges: [getMergeRequestWithChanges()],
      mergeRequestVersions: getMergeRequestVersions(),
      filesRaw: [
        {
          raw: getBlobReadme(),
          path: 'README.md',
        },

miragejs

A client-side server to help you build, test and demo your JavaScript app

MIT
Latest version published 23 days ago

Package Health Score

89 / 100
Full package analysis