Commit Graph

26 Commits

Author SHA1 Message Date
Connor Peet
6a847ba6d1 eng: add support for snapshot tests (#190444)
* eng: add support for snapshot tests

This adds Jest-like support for snapshot testing.
Developers can do something like:

```js
await assertSnapshot(myComplexObject)
```

The first time this is run, the snapshot expectation file is written
to a `__snapshots__` directory beside the test file. Subsequent runs
will compare the object to the snapshot, and fail if it doesn't match.

You can see an example of this in the test for snapshots themselves!

After a successful run, any unused snapshots are cleaned up. On a failed
run, a gitignored `.actual` snapshot file is created beside the
snapshot for easy processing and inspection.

Shortly I will do some integration with the selfhost test extension to
allow developers to easily update snapshots from the vscode UI.

For #189680

cc @ulugbekna @hediet

* fix async stacktraces getting clobbered

* random fixes

* comment out leak detector, for now

* add option to snapshot file extension
2023-08-15 12:03:51 -07:00
Johannes
d555777b1a simplify _VSCODE_NODE_MODULES util 2022-11-18 09:42:32 +01:00
Johannes
8dd8d214d8 don't use __$__nodeRequire to fetch product configuration 2022-11-18 09:41:51 +01:00
Johannes
2d6ad4be88 * add global for node_modules access
* remove most usages of require.__$__nodeRequire
* stop using require.nodeRequire
2022-11-18 09:41:43 +01:00
Raymond Zhao
9feaed8f51 Revert "joh/representative canidae" (#166641) 2022-11-17 13:53:17 -08:00
Johannes
6dd2726c73 simplify _VSCODE_NODE_MODULES util 2022-11-17 17:58:51 +01:00
Johannes
93c3f3202b don't use __$__nodeRequire to fetch product configuration 2022-11-17 15:41:23 +01:00
Johannes
0824db3bad * add global for node_modules access
* remove most usages of require.__$__nodeRequire
* stop using require.nodeRequire
2022-11-17 12:09:14 +01:00
Johannes
15b8f56574 fix rendering/UI for ./scripts/test.sh --dev 2022-10-04 14:51:58 +02:00
Alexandru Dima
a68f9da5fe There is no need to pass in nodeMain when passing in baseUrl (#160893) 2022-09-14 13:04:14 +02:00
Johannes
0656d21d11 auto-fixed prefer-const violation 2022-06-08 17:49:21 +02:00
Alex Dima
cab9713422 Fixes #141994: Address eslint problems 2022-02-02 13:18:12 +01:00
Benjamin Pasero
f317abfd68 layers - clean up top level workbench test folder 2022-01-20 10:47:35 +01:00
Alexandru Dima
7dfe2e33ea Fix test running around loading assertCleanState 2021-10-19 11:09:47 +02:00
Alex Dima
11862795ea Remove LanguageIdentifier and ensure tests dispose instantiated LanguagesRegistry objects 2021-10-18 10:29:16 +02:00
Connor Peet
c6d7cfed8a testing: fix undefined not being reported correctly in results
Fixes #125669
2021-07-07 15:28:55 -07:00
Connor Peet
24ea8408c3 testing: propoagate timeout option for unit tests 2021-04-29 12:19:56 -07:00
Benjamin Pasero
7095f4706c unit tests (electron) - avoid sending circular structures over 2021-04-21 08:13:08 +02:00
Alexandru Dima
533d094020 Allow logging FS access with stacks 2021-01-11 15:32:39 +01:00
Alexandru Dima
2fd00ba9fe Add a way to troubleshoot fs calls 2021-01-11 09:11:33 +01:00
Connor Peet
04d7411785 eng: update mocha 2 -> 8 2020-12-17 11:24:15 -08:00
Benjamin Pasero
7f035b4be7 debt - introduce and adopt FileAccess
deprecate amd.ts and require.toUrl methods
2020-09-25 14:11:05 +02:00
Benjamin Pasero
5497e60ed2 sandbox - consolidate fileUriFromPath into one 2020-09-22 08:14:45 +02:00
Benjamin Pasero
e5b3ff76ba Enable sandbox and contextIsolation for process explorer when running with --__sandbox (#102924)
* sandbox - allow to enable sandbox and contextIsolation for process explorer

* fix asar lookup
2020-07-20 10:30:20 +02:00
Alex Dima
ca5144362b Move coverage.js into test/unit 2020-02-07 12:37:26 +01:00
Benjamin Pasero
5393954877 tests - have a test/unit folder 2020-02-07 09:51:28 +01:00