WIP - add extractor, generate snippet_data
This commit is contained in:
33
node_modules/graphql-compose/lib/utils/__tests__/toDottedObject-test.js
generated
vendored
Normal file
33
node_modules/graphql-compose/lib/utils/__tests__/toDottedObject-test.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
|
||||
var _toDottedObject = _interopRequireDefault(require("../toDottedObject"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
describe('toDottedObject()', () => {
|
||||
it('should dot nested objects', () => {
|
||||
expect((0, _toDottedObject.default)({
|
||||
a: {
|
||||
b: {
|
||||
c: 1
|
||||
}
|
||||
}
|
||||
})).toEqual({
|
||||
'a.b.c': 1
|
||||
});
|
||||
});
|
||||
it('should work with arrays', () => {
|
||||
expect((0, _toDottedObject.default)({
|
||||
a: {
|
||||
b: [{
|
||||
c: 1
|
||||
}, {
|
||||
d: 1
|
||||
}]
|
||||
}
|
||||
})).toEqual({
|
||||
'a.b.0.c': 1,
|
||||
'a.b.1.d': 1
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user