Steve Gravrock
66eb27b0af
Throw if spying has no effect
...
This provides a useful diagnostic in cases where assigning to a property
is a no-op, like localStorage in Firefox and Safari 17.
See #2036 and #2007 .
2024-08-17 09:07:18 -07:00
Mert Akinc
554dfd4923
Update comments as requested
2024-08-05 12:27:11 -05:00
Mert Akinc
97b6f33cc2
Add test, update rexex pattern and constant name
2024-07-26 17:45:23 -05:00
Mert Akinc
a9889ddb31
Improve performance on Playwright Windows WebKit
2024-07-25 09:54:32 -05:00
Steve Gravrock
c3387f8dbf
Merge branch 'stephanreiter-better-toHaveSize'
...
* Merges #2033 from @stephanreiter
2024-07-13 14:02:15 -07:00
Steve Gravrock
3d54184c7f
Docs: Improved discoverability of asymmetric equality testers
2024-07-03 10:17:57 -07:00
Stephan Ferlin-Reiter
6f23e706d7
Improve the error message of the toHaveSize matcher.
...
We include the size of the thing that didn't meet the size expectation.
2024-07-02 20:28:16 +00:00
Steve Gravrock
cc69edf92c
Fixed stack trace filtering in FF when the developer tools are open
2024-06-22 11:49:49 -07:00
Steve Gravrock
ba7560f65e
HTML reporter: show debug logs with white-space: pre
2024-06-22 11:44:11 -07:00
Steve Gravrock
8cd7c94490
Added a jsdoc example for withContext()
...
Fixes jasmine/jasmine.github.io#166
2024-04-16 16:22:25 -07:00
Steve Gravrock
4984548cab
Clarify argument to spyOnGlobalErrorsAsync's spy
2024-03-22 08:53:19 -07:00
Steve Gravrock
6941bde7e2
Revert "Deprecate the suppressLoadErrors option"
...
jasmine-npm still needs this to enable the default behavior of crashing
with a stack trace on load errors.
This reverts commit 99e350ac85 .
2024-03-21 09:34:26 -07:00
Steve Gravrock
1504f25ced
Report the message when a browser error event with a message but no error occurs
2024-03-21 09:15:43 -07:00
Steve Gravrock
99e350ac85
Deprecate the suppressLoadErrors option
...
This was intended as a 3.0 migration aid for browser users who had
dependencies that triggered errors at load time. However, it was never
documented and never supported by jasmine-brower-runner, karma, or any
other commonly used tool for runing Jasmine in the browser. There is
no evidence of it actually being used. It is, however, starting to
show up in machine-generated "tutorials".
2024-03-04 19:35:31 -08:00
Steve Gravrock
1624b07589
Clarify spyOnGlobalErrorsAsync API docs
2024-03-04 19:35:24 -08:00
Steve Gravrock
03098e81f8
Fixed throwUnlessAsync
...
Fixes #2026
2024-02-05 18:49:19 -08:00
Steve Gravrock
4ba42f3746
Fixed global variable leak when using ParallelReportDispatcher
2023-08-22 19:34:22 -07:00
Steve Gravrock
58bee05c36
Documented usage of eval in DelayedFunctionScheduler
2023-08-22 19:28:20 -07:00
Steve Gravrock
c1871b0f0c
Removed unnecessary throw when building stack trace
...
Since 4.0, all supported JS runtimes populate the stack property of
Error objects when the Error is instantiated, not when it's thrown.
2023-08-19 09:54:03 -07:00
Steve Gravrock
c16974b091
Improved jsdocs for originalFn argument to createSpy
...
Fixes jasmine.github.io#137.
2023-08-14 18:32:51 -07:00
Steve Gravrock
a67b7276be
Fixed jsdocs for throwUnless and throwUnlessAsync
2023-07-22 09:36:16 -07:00
Steve Gravrock
75d45efa16
Exclude inherited Error properties from stack trace
...
These are likely to be methods or other things that aren't meaningful in
Jasmine's output.
2023-07-19 19:13:24 -07:00
angrycat9000
2ddb344bac
Skip parsing cause if it is not an Error object
2023-07-19 10:00:50 -04:00
Steve Gravrock
e56bd3918b
Added throwUnless and throwUnlessAsync
...
These are similar to `expect` and `expectAsync` except that they throw
exceptions rather than recording matcher failures as spec/suite failures.
They're intended to support using Jasmine matchers in testing-library's
`waitFor`, and also provide a way to integration-test custom matchers.
These funtions are not equivalent to `expect` and `expectAsync` and should
not be used in situations where you want a matcher failure to reliably fail
the spec. Whether that happens depends on the structure of the surrounding
code. In general, you should only use `throwUnless` when you expect
something (which could be your own code or library code like `waitFor`) to
catch the resulting exception.
Fixes #2003 .
Fixes #1980 .
2023-07-15 12:08:11 -07:00
Steve Gravrock
59600a1c29
Removed expect/expectAsync indirection through spec/suite
2023-07-15 12:08:11 -07:00
Steve Gravrock
ff93277c0f
Accessibility: Always provide a non-color indication that a spec is pending
2023-04-29 11:45:21 -07:00
Steve Gravrock
90741b3cee
Accessibility: Improved contrast of version number and inactive tab links
2023-04-29 11:45:16 -07:00
Steve Gravrock
1e7f07259e
API docs for parallel support things that jasmine-npm uses
2023-04-08 12:37:40 -07:00
Steve Gravrock
c36a5cfd96
Parallel: Cleaner interface for reporter dispatching
...
This gets jasmine-npm out of having to deal with QueueRunner, GlobalErrors,
and ReportDispatcher directly.
2023-04-08 11:41:15 -07:00
Steve Gravrock
299fd1f770
Removed unnecessary TODO
2023-03-25 11:21:04 -07:00
Steve Gravrock
656427d328
Parallel: Disallow calls to Env#config from spec and helper files
...
Such configuration changes only affect one worker, which is almost certainly
not the intent.
2023-03-25 11:16:54 -07:00
Steve Gravrock
04fac300e8
Uninstall the global error at the end of env execution
...
jasmine-npm needs this so that it can do its own error handling during
globalTeardown.
2023-03-11 17:45:31 -08:00
Steve Gravrock
61505f4c59
Fixed post-merge test failures
2023-03-04 14:10:05 -08:00
Steve Gravrock
86eddb05b4
Merge remote-tracking branch 'origin/main' into 5.0
2023-03-04 14:06:43 -08:00
Steve Gravrock
8af5509581
Added a parallel flag to the jasmineStarted reporter event
2023-03-03 20:49:10 -08:00
Steve Gravrock
166e5f4d6c
Report the ID of each suite/spec's parent
...
This is intended to support parallel execution, which is planned for a
future release of Jasmine. Because the execution of unrelated suites will
interleave when run in parallel, reporters will not be able to assume
that the most recent `suiteStarted` event identifies the parent of the
current suite/spec. By adding this feature now, we allow reporters to
support both parallel execution and at least some 4.x versions without
having to implement two different ways of finding the parent suite.
2023-02-25 10:24:14 -08:00
Steve Gravrock
6ad8d20694
Report the path/url of the file that the spec/suite was defined in
...
Fixes #1884
2023-02-15 21:39:21 -08:00
Steve Gravrock
af9a4114f4
Parallel: Improved error messages for top-level before/afterAll
2022-11-25 13:13:05 -08:00
Steve Gravrock
25a7168286
Merge remote-tracking branch 'origin/main' into 5.0
2022-11-24 12:50:39 -08:00
Steve Gravrock
494e81f436
Document that stopOnSpecFailure is best-effort in parallel mode
2022-11-24 12:48:40 -08:00
Steve Gravrock
5e650953cd
Added Safari 16 to supported browsers
2022-10-22 13:08:10 -07:00
Steve Gravrock
ed5e902106
Parallel: Don't allow reporters to be added or removed in worker processes
2022-10-22 09:56:52 -07:00
Steve Gravrock
87f9ab29df
Fixed the jsdoc types of SuiteResult and SpecResult ids
2022-10-19 17:20:24 -07:00
Steve Gravrock
47c64a86d5
Parallel: fail if randomization is disabled or a seed is specified
2022-10-12 20:08:42 -07:00
Steve Gravrock
bb497beeff
Parallel: throw if Env#topSuite is called
2022-10-11 20:16:36 -07:00
Steve Gravrock
e14d9c4be3
Parallel: forbid beforeAll/afterAll at the top level
...
Either running these once total or running them once per process
would be the wrong choice for a significant chunk of users, so do
neither. Later we'll add a new API for exactly-once setup and teardown
in parallel mode.
2022-10-11 20:10:02 -07:00
Steve Gravrock
89e0b35c53
Parallel: throw an error if fit/fdescribe are used in parallel mode
2022-10-11 19:35:59 -07:00
Steve Gravrock
1e7b68236b
Parallel: forbid beforeEach/afterEach at the top level of spec files
...
Each spec file is only loaded in a single worker, so top level
before/afterEach can't behave consistently.
beforeEach/afterEach are still supported in:
* Helper files
* describe() blocks
* At the top level of spec files in non-parallel mode
2022-10-11 19:25:39 -07:00
Steve Gravrock
b831e81074
Include inner exceptions in stack traces
2022-09-24 12:12:21 -07:00
Steve Gravrock
4c13c2b00b
Replaced var with const in API doc examples
2022-09-24 10:12:22 -07:00