@shelf/jest-elasticsearch
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "@shelf/jest-elasticsearch", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Run your tests using jest & elasticsearch-local", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -25,25 +25,27 @@ # jest-elasticsearch | ||
```js | ||
module.exports = { | ||
esVersion: '7.5.0', | ||
clusterName: 'your-cluster-name', | ||
nodeName: 'your-node-name', | ||
port: 9200, | ||
indexes: [ | ||
{ | ||
name: 'your-index-name', | ||
body: { | ||
settings: { | ||
number_of_shards: '1', | ||
number_of_replicas: '1' | ||
}, | ||
aliases: { | ||
'your-alias': {} | ||
}, | ||
mappings: { | ||
dynamic: false, | ||
properties: { | ||
//here you should paste your mapping | ||
//Example: | ||
id: { | ||
type: "keyword" | ||
module.exports = () => { | ||
return { | ||
esVersion: '7.5.0', // <== must be < 7.5.0 | ||
clusterName: 'your-cluster-name', | ||
nodeName: 'your-node-name', | ||
port: 9200, | ||
indexes: [ | ||
{ | ||
name: 'your-index-name', | ||
body: { | ||
settings: { | ||
number_of_shards: '1', | ||
number_of_replicas: '1' | ||
}, | ||
aliases: { | ||
'your-alias': {} | ||
}, | ||
mappings: { | ||
dynamic: false, | ||
properties: { | ||
//here you should paste your mapping | ||
//Example: | ||
id: { | ||
type: "keyword" | ||
} | ||
} | ||
@@ -53,5 +55,5 @@ } | ||
} | ||
} | ||
] | ||
}; | ||
] | ||
} | ||
} | ||
``` | ||
@@ -58,0 +60,0 @@ |
const {resolve} = require('path'); | ||
const cwd = require('cwd'); | ||
const {start} = require('@shelf/elasticsearch-local'); | ||
const getClusterSetting = require('./jest-es-config'); | ||
module.exports = async function startES() { | ||
const userConfig = require(resolve(cwd(), 'jest-es-config.js')); | ||
const config = require(resolve(cwd(), 'jest-es-config.js'))(); | ||
if (typeof userConfig === 'object') { | ||
return start(userConfig); | ||
} | ||
return start(getClusterSetting()); | ||
return start(config); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77
3823
40