Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed Oct 27, 2020
1 parent 9807b16 commit 1d89ce1
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"my_index_signature_prop": {
"properties": {
"avg": {
"type": "number"
"type": "long"
},
"count": {
"type": "number"
"type": "long"
},
"max": {
"type": "number"
"type": "long"
},
"min": {
"type": "number"
"type": "long"
}
}
},
Expand All @@ -27,7 +27,7 @@
"my_objects": {
"properties": {
"total": {
"type": "number"
"type": "long"
},
"type": {
"type": "boolean"
Expand All @@ -39,7 +39,7 @@
"items": {
"properties": {
"total": {
"type": "number"
"type": "long"
},
"type": {
"type": "boolean"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const parsedIndexedInterfaceWithNoMatchingSchema: ParsedUsageCollection =
value: {
something: {
count_1: {
type: 'number',
type: 'long',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const parsedSchemaDefinedWithSpreadsCollector: ParsedUsageCollection = [
},
my_objects: {
total: {
type: 'number',
type: 'long',
},
type: {
type: 'boolean',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ export const parsedWorkingCollector: ParsedUsageCollection = [
},
my_index_signature_prop: {
avg: {
type: 'number',
type: 'long',
},
count: {
type: 'number',
type: 'long',
},
max: {
type: 'number',
type: 'long',
},
min: {
type: 'number',
type: 'long',
},
},
my_objects: {
total: {
type: 'number',
type: 'long',
},
type: {
type: 'boolean',
Expand All @@ -58,7 +58,7 @@ export const parsedWorkingCollector: ParsedUsageCollection = [
type: 'array',
items: {
total: {
type: 'number',
type: 'long',
},
type: { type: 'boolean' },
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('checkMatchingMapping', () => {
it('returns diff on mismatching parsedCollections and stored mapping', async () => {
const mockSchema = await parseJsonFile('mock_schema.json');
const malformedParsedCollector = cloneDeep(parsedWorkingCollector);
const fieldMapping = { type: 'number' };
const fieldMapping = { type: 'long' };
malformedParsedCollector[1].schema.value.flat = fieldMapping;

const diffs = checkMatchingMapping([malformedParsedCollector], mockSchema);
Expand All @@ -61,9 +61,9 @@ describe('checkMatchingMapping', () => {
const mockSchema = await parseJsonFile('mock_schema.json');
const malformedParsedCollector = cloneDeep(parsedWorkingCollector);
const collectorName = 'New Collector in town!';
const collectorMapping = { some_usage: { type: 'number' } };
const collectorMapping = { some_usage: { type: 'long' } };
malformedParsedCollector[1].collectorName = collectorName;
malformedParsedCollector[1].schema.value = { some_usage: { type: 'number' } };
malformedParsedCollector[1].schema.value = { some_usage: { type: 'long' } };

const diffs = checkMatchingMapping([malformedParsedCollector], mockSchema);
expect(diffs).toEqual({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const someSchema: MakeSchemaFrom<Pick<Usage, 'flat' | 'my_str'>> = {
const someOtherSchema: MakeSchemaFrom<Pick<Usage, 'my_objects'>> = {
my_objects: {
total: {
type: 'number',
type: 'long',
},
type: { type: 'boolean' },
},
Expand Down
12 changes: 6 additions & 6 deletions src/fixtures/telemetry_collectors/working_collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,25 @@ export const myCollector = makeUsageCollector<Usage>({
},
my_objects: {
total: {
type: 'number',
type: 'long',
},
type: { type: 'boolean' },
},
my_array: {
type: 'array',
items: {
total: {
type: 'number',
type: 'long',
},
type: { type: 'boolean' },
},
},
my_str_array: { type: 'array', items: { type: 'keyword' } },
my_index_signature_prop: {
count: { type: 'number' },
avg: { type: 'number' },
max: { type: 'number' },
min: { type: 'number' },
count: { type: 'long' },
avg: { type: 'long' },
max: { type: 'long' },
min: { type: 'long' },
},
},
});

0 comments on commit 1d89ce1

Please sign in to comment.