Skip to content

Commit

Permalink
Simplify test fixture "schema_defined_with_spreads"
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo committed Sep 29, 2020
1 parent 1de0553 commit 2ef7def
Showing 1 changed file with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,15 @@ export const myCollector = makeUsageCollector<Usage>({
isReady: () => true,
fetch() {
const testString = '123';
// query ES and get some data

// summarize the data into a model
// return the modeled object that includes whatever you want to track
try {
return {
flat: 'hello',
my_str: testString,
my_objects: {
total: SOME_NUMBER,
type: true,
},
};
} catch (err) {
return {
my_objects: {
total: 0,
type: true,
},
};
}
return {
flat: 'hello',
my_str: testString,
my_objects: {
total: SOME_NUMBER,
type: true,
},
};
},
schema: {
...someSchema,
Expand Down

0 comments on commit 2ef7def

Please sign in to comment.