-
Notifications
You must be signed in to change notification settings - Fork 3
/
mongoose-fixture-config.js
72 lines (67 loc) · 1.75 KB
/
mongoose-fixture-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* mongoose-fixture-config.js.js
* Type: Config
* Generated by mongoose-fixture (v0.4.1)
*
* Generic configuration
* Please customize your mongodb, pathing, and FixtureListing
*
*/
// Load the default object that helps manage a FixtureConfig
var FixtureConfig = require('mongoose-fixture').FixtureConfig;
// Create our fixture config with defined
// mongo-connection and file paths
var fixtureConfig = FixtureConfig({
mongoConnection:{
'host':'localhost',
'port':'27017',
'dbname':'ehr-designer'
},
paths:{
schemaPath:__dirname+'/lib/models/',
dataFixturePath:__dirname+'/lib/fixtures/'
}
});
// Create a Listing of fixtures
var fixtures =
[
{
itemName:'UIElement',
schema:'element',
data:'elements',
collection:'elements'
},
{
itemName:'UIComponent',
schema:'component',
data:'components',
collection:'components'
},
{
itemName:'Template',
schema:'template',
data:'templates',
collection:'templates'
},
{
itemName:'ExportType',
schema:'exportType',
data:'export-types',
collection:'exporttypes'
},
{
itemName:'DesignRule',
schema:'designRule',
data:'design-rules',
collection:'designrules'
}
];
// load fixture listings
fixtureConfig.fixtureListings.set('all', fixtures);
fixtureConfig.fixtureListings.set('elements', [fixtures[0]]);
fixtureConfig.fixtureListings.set('components', [fixtures[1]]);
fixtureConfig.fixtureListings.set('templates', [fixtures[2]]);
fixtureConfig.fixtureListings.set('export-types', [fixtures[3]]);
fixtureConfig.fixtureListings.set('design-rules', [fixtures[4]]);
// export the config
module.exports = fixtureConfig;