Skip to content
This repository has been archived by the owner on Dec 23, 2019. It is now read-only.

Working with flat json files instead of a server

Dave Allen edited this page Jul 23, 2013 · 1 revision

In order to work without a server, we can use the devel_config. This uses pre-written JSON data to fake the calls to and from the server. To set it up so that this config is used, go to main.js and change the path for the config parameter:

require.config({
  shim:{
  },

  baseUrl: '.',

  paths:{
    hm:                   'vendor/hm',
    esprima:              'vendor/esprima',
    jquery:               'vendor/jquery.min',
    text:                 'components/requirejs-text/text',
    spinjs:               'components/spin.js/spin',
    labware:              'components/labware/app/scripts',
    mapper:               'components/S2Mapper/app/scripts/mapper',
    mapper_services:      'components/S2Mapper/app/scripts/services',
    mapper_test:          'components/S2Mapper/test',
    mapper_testjson:      'components/S2Mapper/test/json',
    extraction_pipeline:  'scripts',
    
    // this line changed from 'scripts/config'
    config:               'scripts/devel_config',
    reception_templates:  'scripts/lib/reception_templates'
  }
});...

Instead of using config, devel_config will be used. devel_config uses the test_config from the S2Mapper. devel_config is currently set to load the data from dna_and_ran_manual_test_data.json. More details on how test_config works can be found in our testing documentation.

Current Data, and how to generate more

There is currently enough data in the file to take you to the end of the kit binding phase.

This file should be extended to go through entire processes. This could be done by hand, but this is very time consuming and subject to error. A better way of doing this is by using ruby scripts in the lims-api-examples. This way, data can be regenerated easily if there are changes in the code.

There are two key benefits to having this data:

  • Being able to test things by hand, without access to a server.
  • Able to set up integration test scripts using this data.