Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
418523d
Display Jasmine test results in Karma browsers
mattsoulanille Jun 9, 2022
3155ca8
Merge remote-tracking branch 'upstream/master' into karma_jasmine_htm…
mattsoulanille Jun 22, 2022
07bfc7a
[layers] Remove 'async (done) =>' Jasmine antipattern
mattsoulanille Jun 22, 2022
a60eacf
Update jasmine and jasmine types
mattsoulanille Jun 22, 2022
c012e8a
Upgrade karma-jasmine to ~5.1.0 to fix specFilter not working
mattsoulanille Jun 22, 2022
385092e
[webgl] Fix test value type
mattsoulanille Jun 22, 2022
da458a9
[tflite] Fix test esbuild bundle missing input files
mattsoulanille Jun 17, 2022
90422a4
[data] Remove deprecated 'async (done) =>' jasmine style
mattsoulanille Jun 23, 2022
4ebf81b
[data] Use a browser that allows autoplay
mattsoulanille Jun 23, 2022
69b67b0
Comment out 'wasm pre.js' describe, which has only disabled tests
mattsoulanille Jun 23, 2022
6e0cd3d
Remove 'Response' constructor from util_test to work in Node
mattsoulanille Jun 23, 2022
004ef46
Merge remote-tracking branch 'upstream/master' into karma_jasmine_htm…
mattsoulanille Jun 23, 2022
5be5f24
Bump tsconfig lib to es2019
mattsoulanille Jun 23, 2022
75e3cf8
[converter] Avoid spying on properties of the 'tfOps' module
mattsoulanille Jun 23, 2022
4851622
Disable no-any for spyOps type assertion
mattsoulanille Jun 23, 2022
099479e
Add module_name back to converter test lib
mattsoulanille Jun 23, 2022
fa157c2
[converter] Remove deprecated 'async (done) =>' jasmine style
mattsoulanille Jun 24, 2022
e522d10
Merge branch 'master' into karma_jasmine_html_reporter
mattsoulanille Jun 24, 2022
8bdb229
Bazel lint
mattsoulanille Jun 24, 2022
bf939f0
lint
mattsoulanille Jun 24, 2022
e5f586b
Use describeWithFlags instead of an if statement to disable tests tha…
mattsoulanille Jun 24, 2022
bea3ac5
Merge branch 'master' into karma_jasmine_html_reporter
mattsoulanille Jun 27, 2022
d1de3a1
Merge branch 'master' into karma_jasmine_html_reporter
mattsoulanille Jun 29, 2022
1da4de3
Fix lint errors
mattsoulanille Jun 29, 2022
dd2cdce
Merge branch 'master' into karma_jasmine_html_reporter
mattsoulanille Jun 29, 2022
f85c244
Merge branch 'master' into karma_jasmine_html_reporter
mattsoulanille Jun 29, 2022
b2c93fa
Merge branch 'master' into karma_jasmine_html_reporter
mattsoulanille Jun 29, 2022
9a96d24
Merge branch 'master' into karma_jasmine_html_reporter
mattsoulanille Jun 29, 2022
172db2c
Merge branch 'master' into karma_jasmine_html_reporter
mattsoulanille Jun 29, 2022
dc9fc38
Add missing jasmine dependency to automl and update rollup-plugin-typ…
mattsoulanille Jun 29, 2022
241835e
Fix e2e tests
mattsoulanille Jun 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update jasmine and jasmine types
  • Loading branch information
mattsoulanille committed Jun 22, 2022
commit a60eacfaff3e9c400618f3f49cd84f9f3fa4c8ef
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@types/argparse": "^1.0.38",
"@types/emscripten": "~0.0.34",
"@types/estree": "^0.0.51",
"@types/jasmine": "~3.0.0",
"@types/jasmine": "~4.0.3",
"@types/js-yaml": "^4.0.5",
"@types/long": "4.0.1",
"@types/mkdirp": "^0.5.2",
Expand All @@ -36,8 +36,8 @@
"core-js": "3",
"deep-equal": "^1.0.1",
"estree-walker": "~1.0.1",
"jasmine": "~4.1.0",
"jasmine-core": "~4.1.1",
"jasmine": "~4.2.1",
"jasmine-core": "~4.2.0",
"js-yaml": "^3.14.0",
"karma": "^6.3.20",
"karma-browserstack-launcher": "^1.6.0",
Expand Down
2 changes: 1 addition & 1 deletion tfjs-core/src/io/browser_files_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describeWithFlags('browserDownloads', BROWSER_ENVS, () => {
fakeAnchorCount = 0;
fakeAnchors = [new FakeHTMLAnchorElement(), new FakeHTMLAnchorElement()];
spyOn(document, 'createElement').and.callFake((tag: string) => {
return fakeAnchors[fakeAnchorCount++];
return fakeAnchors[fakeAnchorCount++] as unknown as HTMLElement;
});
});

Expand Down
2 changes: 1 addition & 1 deletion tfjs-core/src/io/http_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const fakeResponse =
},
headers: {get: (key: string) => contentType},
url: path
});
}) as unknown as Response;

const setupFakeWeightFiles =
(fileBufferMap: {
Expand Down
2 changes: 1 addition & 1 deletion tfjs-core/src/io/weights_loader_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describeWithFlags('loadWeights', BROWSER_ENVS, () => {
[filename: string]: Float32Array|Int32Array|ArrayBuffer|Uint8Array|
Uint16Array
}) => {
spyOn(tf.env().platform, 'fetch').and.callFake((path: string) => {
spyOn(tf.env().platform, 'fetch').and.callFake(async (path: string) => {
return new Response(
fileBufferMap[path],
{headers: {'Content-type': 'application/octet-stream'}});
Expand Down
7 changes: 5 additions & 2 deletions tfjs-core/src/jasmine_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ export function setupTestFilters(
const env = jasmine.getEnv();

// Account for --grep flag passed to karma by saving the existing specFilter.
const grepFilter = env.specFilter;
const config = env.configuration();
const grepFilter = config.specFilter;

/**
* Filter method that returns boolean, if a given test should run or be
Expand All @@ -126,7 +127,7 @@ export function setupTestFilters(
* list, it will be exluded.
*/
// tslint:disable-next-line: no-any
env.specFilter = (spec: any) => {
const specFilter = (spec: any) => {
// Filter out tests if the --grep flag is passed.
if (!grepFilter(spec)) {
return false;
Expand Down Expand Up @@ -159,6 +160,8 @@ export function setupTestFilters(
// Otherwise ignore the test.
return false;
};

env.configure({...config, specFilter});
}

export function parseTestEnvFromKarmaFlags(
Expand Down
2 changes: 1 addition & 1 deletion tfjs-core/src/platforms/platform_browser_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {PlatformBrowser} from './platform_browser';
describeWithFlags('PlatformBrowser', BROWSER_ENVS, async () => {
it('fetch calls window.fetch', async () => {
const response = new Response();
spyOn(self, 'fetch').and.returnValue(response);
spyOn(self, 'fetch').and.returnValue(Promise.resolve(response));
const platform = new PlatformBrowser();

await platform.fetch('test/url', {method: 'GET'});
Expand Down
4 changes: 2 additions & 2 deletions tfjs-core/src/platforms/platform_node_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describeWithFlags('PlatformNode', NODE_ENVS, () => {
// Null out the system fetch so we force it to require node-fetch.
platform_node.resetSystemFetch();

const testFetch = {fetch: (url: string, init: RequestInit) => {}};
const testFetch = {fetch: (url: string, init: RequestInit) => () => {}};

// Mock the actual fetch call.
spyOn(testFetch, 'fetch').and.returnValue(() => {});
Expand All @@ -71,7 +71,7 @@ describeWithFlags('PlatformNode', NODE_ENVS, () => {
});

it('now should use process.hrtime', async () => {
const time = [100, 200];
const time: [number, number] = [100, 200];
spyOn(process, 'hrtime').and.returnValue(time);
expect(tf.env().platform.now()).toEqual(time[0] * 1000 + time[1] / 1000000);
});
Expand Down
2 changes: 1 addition & 1 deletion tfjs-core/src/util_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ describeWithFlags('util.toNestedArray for a complex tensor', ALL_ENVS, () => {

describe('util.fetch', () => {
it('should call the platform fetch', () => {
spyOn(tf.env().platform, 'fetch').and.callFake(() => {});
spyOn(tf.env().platform, 'fetch').and.callFake(async () => new Response());

util.fetch('test/path', {method: 'GET'});

Expand Down