-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
257 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"project": "Neureka", | ||
"version": "0.20.1", | ||
"created": "Thu Jun 29 18:08:38 CEST 2023", | ||
"statistics": { | ||
"runs": "99", | ||
"passed": "99", | ||
"failed": "0", | ||
"featureFailures": "0", | ||
"successRate": "1.0", | ||
"duration": "?" | ||
}, | ||
"specifications": [ | ||
{ | ||
"className": "Example_Spec.Example_Spec", | ||
"title": "An Introduction to writing Spock Specifications", | ||
"narrative": "Hello and welcome to the example / template specification of this project.\n This is a simple introduction as to how to get started writing Spock specifications.\n\n Spock works on top of Groovy which is in essence a syntactic super-set of Java.\n That means that one can write Java code in Groovy, and 99% of the time it will \n work the exact same way.", | ||
"featureCount": "5", | ||
"failures": "0", | ||
"errors": "0", | ||
"skipped": "0", | ||
"successRate": "1.0", | ||
"duration": "?", | ||
"executedFeatures": [ | ||
{ "id": "Call me feature not unit test!", "extraInfo": [] }, | ||
{ | ||
"id": "I am readable and also best practice!", | ||
"extraInfo": [] | ||
}, | ||
{ | ||
"id": "Numbers to the power of two with a fancy data table!", | ||
"extraInfo": [] | ||
} | ||
], | ||
"ignoredFeatures": [] | ||
}, | ||
{ | ||
"className": "it.Calculus_Stress_Test", | ||
"title": "", | ||
"narrative": "", | ||
"featureCount": "5", | ||
"failures": "0", | ||
"errors": "0", | ||
"skipped": "0", | ||
"successRate": "1.0", | ||
"duration": "?", | ||
"executedFeatures": [ | ||
{ | ||
"id": "Activation functions work across types, on large prime sized 1D slices and non sliced 1D tensors.", | ||
"extraInfo": [] | ||
}, | ||
{ | ||
"id": "Activation functions work across types.", | ||
"extraInfo": [] | ||
}, | ||
{ | ||
"id": "Dot operation stress test runs error free and produces expected result", | ||
"extraInfo": [] | ||
} | ||
], | ||
"ignoredFeatures": [] | ||
}, | ||
{ | ||
"className": "it.Cross_Device_Sliced_Tensor_System_Test", | ||
"title": "Cross Device Tensor Slicing", | ||
"narrative": "", | ||
"featureCount": "2", | ||
"failures": "0", | ||
"errors": "0", | ||
"skipped": "0", | ||
"successRate": "1.0", | ||
"duration": "?", | ||
"executedFeatures": [ | ||
{ | ||
"id": "Cross device sliced tensor integration test runs without errors.", | ||
"extraInfo": [] | ||
}, | ||
{ | ||
"id": "Slices can be created using the SliceBuilder.", | ||
"extraInfo": [] | ||
} | ||
], | ||
"ignoredFeatures": [] | ||
} | ||
], | ||
"generator": "https://github.com/renatoathaydes/spock-reports" | ||
} |
66 changes: 66 additions & 0 deletions
66
src/Hooks/useGenerateSearchEntries/useGenerateSearchEntries.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { expect, test } from 'vitest'; | ||
|
||
import { renderHook } from '@testing-library/react-hooks'; | ||
import { HookProvider } from '../../test-utils'; | ||
import mockedSummery from './mockSummery.json'; | ||
import { useGenerateSearchEntries } from './useGenerateSearchEntries'; | ||
import { IMinimizedSummaryEntry } from 'spock-react/components/search-types'; | ||
|
||
const minimizedSummaries: IMinimizedSummaryEntry[] = [ | ||
{ | ||
className: 'Example_Spec.Example_Spec', | ||
title: 'An Introduction to writing Spock Specifications', | ||
narrative: | ||
'Hello and welcome to the example / template specification of this project.\n This is a simple introduction as to how to get started writing Spock specifications.\n\n Spock works on top of Groovy which is in essence a syntactic super-set of Java.\n That means that one can write Java code in Groovy, and 99% of the time it will \n work the exact same way.', | ||
features: [ | ||
{ id: 'Call me feature not unit test!' }, | ||
{ | ||
id: 'I am readable and also best practice!', | ||
}, | ||
{ | ||
id: 'Numbers to the power of two with a fancy data table!', | ||
}, | ||
], | ||
}, | ||
{ | ||
className: 'it.Calculus_Stress_Test', | ||
title: '', | ||
narrative: '', | ||
features: [ | ||
{ | ||
id: 'Activation functions work across types, on large prime sized 1D slices and non sliced 1D tensors.', | ||
}, | ||
{ | ||
id: 'Activation functions work across types.', | ||
}, | ||
{ | ||
id: 'Dot operation stress test runs error free and produces expected result', | ||
}, | ||
], | ||
}, | ||
{ | ||
className: 'it.Cross_Device_Sliced_Tensor_System_Test', | ||
title: 'Cross Device Tensor Slicing', | ||
narrative: '', | ||
features: [ | ||
{ | ||
id: 'Cross device sliced tensor integration test runs without errors.', | ||
}, | ||
{ | ||
id: 'Slices can be created using the SliceBuilder.', | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
test('hook example', () => { | ||
const { result } = renderHook( | ||
() => useGenerateSearchEntries({ summary: mockedSummery }), | ||
{ | ||
wrapper: HookProvider, | ||
} | ||
); | ||
|
||
expect(result.current?.length).toBe(3); | ||
expect(result.current).toStrictEqual(minimizedSummaries); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
import { http, HttpResponse } from 'msw'; | ||
import mockedSummery from './mockedSummery.json'; | ||
|
||
export const handlers = [ | ||
http.get('*summary.json', () => { | ||
return new HttpResponse( | ||
JSON.stringify({ | ||
name: '', | ||
}), | ||
{ | ||
status: 200, | ||
} | ||
); | ||
return new HttpResponse(JSON.stringify(mockedSummery), { | ||
status: 200, | ||
}); | ||
}), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"project": "Neureka", | ||
"version": "0.20.1", | ||
"created": "Thu Jun 29 18:08:38 CEST 2023", | ||
"statistics": { | ||
"runs": "99", | ||
"passed": "99", | ||
"failed": "0", | ||
"featureFailures": "0", | ||
"successRate": "1.0", | ||
"duration": "?" | ||
}, | ||
"specifications": [ | ||
{ | ||
"className": "Example_Spec.Example_Spec", | ||
"title": "An Introduction to writing Spock Specifications", | ||
"narrative": "Hello and welcome to the example / template specification of this project.\n This is a simple introduction as to how to get started writing Spock specifications.\n\n Spock works on top of Groovy which is in essence a syntactic super-set of Java.\n That means that one can write Java code in Groovy, and 99% of the time it will \n work the exact same way.", | ||
"featureCount": "5", | ||
"failures": "0", | ||
"errors": "0", | ||
"skipped": "0", | ||
"successRate": "1.0", | ||
"duration": "?", | ||
"executedFeatures": [ | ||
{ "id": "Call me feature not unit test!", "extraInfo": [] }, | ||
{ | ||
"id": "I am readable and also best practice!", | ||
"extraInfo": [] | ||
}, | ||
{ | ||
"id": "Numbers to the power of two with a fancy data table!", | ||
"extraInfo": [] | ||
} | ||
], | ||
"ignoredFeatures": [] | ||
}, | ||
{ | ||
"className": "it.Calculus_Stress_Test", | ||
"title": "", | ||
"narrative": "", | ||
"featureCount": "5", | ||
"failures": "0", | ||
"errors": "0", | ||
"skipped": "0", | ||
"successRate": "1.0", | ||
"duration": "?", | ||
"executedFeatures": [ | ||
{ | ||
"id": "Activation functions work across types, on large prime sized 1D slices and non sliced 1D tensors.", | ||
"extraInfo": [] | ||
}, | ||
{ | ||
"id": "Activation functions work across types.", | ||
"extraInfo": [] | ||
}, | ||
{ | ||
"id": "Dot operation stress test runs error free and produces expected result", | ||
"extraInfo": [] | ||
} | ||
], | ||
"ignoredFeatures": [] | ||
}, | ||
{ | ||
"className": "it.Cross_Device_Sliced_Tensor_System_Test", | ||
"title": "Cross Device Tensor Slicing", | ||
"narrative": "", | ||
"featureCount": "2", | ||
"failures": "0", | ||
"errors": "0", | ||
"skipped": "0", | ||
"successRate": "1.0", | ||
"duration": "?", | ||
"executedFeatures": [ | ||
{ | ||
"id": "Cross device sliced tensor integration test runs without errors.", | ||
"extraInfo": [] | ||
}, | ||
{ | ||
"id": "Slices can be created using the SliceBuilder.", | ||
"extraInfo": [] | ||
} | ||
], | ||
"ignoredFeatures": [] | ||
} | ||
], | ||
"generator": "https://github.com/renatoathaydes/spock-reports" | ||
} |