onnxruntime/js/web/test
Yulong Wang b8917ad84f
[js/web] fix nodejs detection (#16400)
### Description
We used to use `typeof fetch === 'undefined'` as condition to detect the
environment is Node.js or not. Before Node.js v18, this works. However,
in Node.js v18, it introduced `fetch` function, so this check does not
work any more.

This PR changes the condition to check whether `process`,
`process.versions` and `process.versions.node` exists.

Checking whether `process` exists is not enough. This is because in some
configuration, webpack may polyfill nodejs's process.
2023-06-20 00:20:58 -07:00
..
data/ops [js/web] WebGL backend refactor (#8586) 2021-08-12 12:30:49 -07:00
e2e [js/common] refactor tensor type in onnxruntime-common (#15843) 2023-06-09 16:19:29 -07:00
unittests [js] upgrade async@3.2.3 /js/ (#11421) 2022-05-03 23:41:36 -07:00
suite-test-list.jsonc [js/web] Added Reduce operators support (#16122) 2023-06-12 07:46:27 -07:00
test-main.ts [js/web] WebGPU backend via JSEP (#14579) 2023-04-24 15:21:18 -07:00
test-runner.ts [js/web] fix nodejs detection (#16400) 2023-06-20 00:20:58 -07:00
test-shared.ts [js/web] fix nodejs detection (#16400) 2023-06-20 00:20:58 -07:00
test-types.ts [js] add API that allows to get package version (#16207) 2023-06-09 16:18:53 -07:00