From 4c13c2b00b971407eaf0722f78968887c3098430 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sat, 24 Sep 2022 10:12:22 -0700 Subject: [PATCH 1/9] Replaced var with const in API doc examples --- lib/jasmine-core/jasmine.js | 4 ++-- src/core/matchers/matchersUtil.js | 2 +- src/core/matchers/toHaveClass.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 459e9248..ad3eadc4 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -5241,7 +5241,7 @@ getJasmineRequireObj().MatchersUtil = function(j$) { * }; * } * - * var actual = { + * const actual = { * n: 2, * otherFields: "don't care" * }; @@ -6387,7 +6387,7 @@ getJasmineRequireObj().toHaveClass = function(j$) { * @since 3.0.0 * @param {Object} expected - The class name to test for * @example - * var el = document.createElement('div'); + * const el = document.createElement('div'); * el.className = 'foo bar baz'; * expect(el).toHaveClass('bar'); */ diff --git a/src/core/matchers/matchersUtil.js b/src/core/matchers/matchersUtil.js index b7294d16..2e4ae2b5 100644 --- a/src/core/matchers/matchersUtil.js +++ b/src/core/matchers/matchersUtil.js @@ -652,7 +652,7 @@ getJasmineRequireObj().MatchersUtil = function(j$) { * }; * } * - * var actual = { + * const actual = { * n: 2, * otherFields: "don't care" * }; diff --git a/src/core/matchers/toHaveClass.js b/src/core/matchers/toHaveClass.js index 218e729c..034b6f29 100644 --- a/src/core/matchers/toHaveClass.js +++ b/src/core/matchers/toHaveClass.js @@ -6,7 +6,7 @@ getJasmineRequireObj().toHaveClass = function(j$) { * @since 3.0.0 * @param {Object} expected - The class name to test for * @example - * var el = document.createElement('div'); + * const el = document.createElement('div'); * el.className = 'foo bar baz'; * expect(el).toHaveClass('bar'); */ From b831e81074cce5c1426659a4ef20606c241818b2 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sat, 24 Sep 2022 12:06:02 -0700 Subject: [PATCH 2/9] Include inner exceptions in stack traces --- lib/jasmine-core/jasmine.js | 34 ++++++++++++++++----- spec/core/ExceptionFormatterSpec.js | 46 +++++++++++++++++++++++++++++ src/core/ExceptionFormatter.js | 34 ++++++++++++++++----- 3 files changed, 100 insertions(+), 14 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index ad3eadc4..fda51281 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -3494,18 +3494,38 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) { return null; } - const stackTrace = new j$.StackTrace(error); - const lines = filterJasmine(stackTrace); - let result = ''; + const lines = this.stack_(error, { + messageHandling: omitMessage ? 'omit' : undefined + }); + return lines.join('\n'); + }; - if (stackTrace.message && !omitMessage) { + // messageHandling can be falsy (unspecified), 'omit', or 'require' + this.stack_ = function(error, { messageHandling }) { + let lines = formatProperties(error).split('\n'); + + if (lines[lines.length - 1] === '') { + lines.pop(); + } + + const stackTrace = new j$.StackTrace(error); + lines = lines.concat(filterJasmine(stackTrace)); + + if (messageHandling === 'require') { + lines.unshift(stackTrace.message || 'Error: ' + error.message); + } else if (messageHandling !== 'omit' && stackTrace.message) { lines.unshift(stackTrace.message); } - result += formatProperties(error); - result += lines.join('\n'); + if (error.cause) { + const substack = this.stack_(error.cause, { + messageHandling: 'require' + }); + substack[0] = 'Caused by: ' + substack[0]; + lines = lines.concat(substack); + } - return result; + return lines; }; function filterJasmine(stackTrace) { diff --git a/spec/core/ExceptionFormatterSpec.js b/spec/core/ExceptionFormatterSpec.js index 3f410e10..39c8f5f9 100644 --- a/spec/core/ExceptionFormatterSpec.js +++ b/spec/core/ExceptionFormatterSpec.js @@ -256,5 +256,51 @@ describe('ExceptionFormatter', function() { expect(result).not.toContain('an error'); }); }); + + describe('In environments that support the cause property of Errors', function() { + beforeEach(function() { + const inner = new Error('inner'); + const outer = new Error('outer', { cause: inner }); + + if (!outer.cause) { + // Currently: Node 12, Node 14, Safari 14 + pending('Environment does not support error cause'); + } + }); + + it('recursively includes the cause in the stack trace in this environment', function() { + const subject = new jasmineUnderTest.ExceptionFormatter(); + const rootCause = new Error('root cause'); + const proximateCause = new Error('proximate cause', { + cause: rootCause + }); + const symptom = new Error('symptom', { cause: proximateCause }); + + const lines = subject.stack(symptom).split('\n'); + // Not all environments include the message in the stack trace. + const hasRootMessage = lines[0].indexOf('symptom') !== -1; + const firstSymptomStackIx = hasRootMessage ? 1 : 0; + + expect(lines[firstSymptomStackIx]) + .withContext('first symptom stack frame') + .toContain('ExceptionFormatterSpec.js'); + const proximateCauseMsgIx = lines.indexOf( + 'Caused by: Error: proximate cause' + ); + expect(proximateCauseMsgIx) + .withContext('index of proximate cause message') + .toBeGreaterThan(firstSymptomStackIx); + expect(lines[proximateCauseMsgIx + 1]) + .withContext('first proximate cause stack frame') + .toContain('ExceptionFormatterSpec.js'); + const rootCauseMsgIx = lines.indexOf('Caused by: Error: root cause'); + expect(rootCauseMsgIx) + .withContext('index of root cause message') + .toBeGreaterThan(proximateCauseMsgIx + 1); + expect(lines[rootCauseMsgIx + 1]) + .withContext('first root cause stack frame') + .toContain('ExceptionFormatterSpec.js'); + }); + }); }); }); diff --git a/src/core/ExceptionFormatter.js b/src/core/ExceptionFormatter.js index e5ba82ed..0d69458b 100644 --- a/src/core/ExceptionFormatter.js +++ b/src/core/ExceptionFormatter.js @@ -44,18 +44,38 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) { return null; } - const stackTrace = new j$.StackTrace(error); - const lines = filterJasmine(stackTrace); - let result = ''; + const lines = this.stack_(error, { + messageHandling: omitMessage ? 'omit' : undefined + }); + return lines.join('\n'); + }; - if (stackTrace.message && !omitMessage) { + // messageHandling can be falsy (unspecified), 'omit', or 'require' + this.stack_ = function(error, { messageHandling }) { + let lines = formatProperties(error).split('\n'); + + if (lines[lines.length - 1] === '') { + lines.pop(); + } + + const stackTrace = new j$.StackTrace(error); + lines = lines.concat(filterJasmine(stackTrace)); + + if (messageHandling === 'require') { + lines.unshift(stackTrace.message || 'Error: ' + error.message); + } else if (messageHandling !== 'omit' && stackTrace.message) { lines.unshift(stackTrace.message); } - result += formatProperties(error); - result += lines.join('\n'); + if (error.cause) { + const substack = this.stack_(error.cause, { + messageHandling: 'require' + }); + substack[0] = 'Caused by: ' + substack[0]; + lines = lines.concat(substack); + } - return result; + return lines; }; function filterJasmine(stackTrace) { From 87f9ab29dffd7955b7faa94e752f03f5e29b25be Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Wed, 19 Oct 2022 17:20:24 -0700 Subject: [PATCH 3/9] Fixed the jsdoc types of SuiteResult and SpecResult ids --- lib/jasmine-core/jasmine.js | 4 ++-- src/core/Spec.js | 2 +- src/core/Suite.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index fda51281..c32d9ab3 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -776,7 +776,7 @@ getJasmineRequireObj().Spec = function(j$) { /** * @typedef SpecResult - * @property {Int} id - The unique id of this spec. + * @property {String} id - The unique id of this spec. * @property {String} description - The description passed to the {@link it} that created this spec. * @property {String} fullName - The full description including all ancestors of this spec. * @property {Expectation[]} failedExpectations - The list of expectations that failed during execution of this spec. @@ -9631,7 +9631,7 @@ getJasmineRequireObj().Suite = function(j$) { Suite.prototype.reset = function() { /** * @typedef SuiteResult - * @property {Int} id - The unique id of this suite. + * @property {String} id - The unique id of this suite. * @property {String} description - The description text passed to the {@link describe} that made this suite. * @property {String} fullName - The full description including all ancestors of this suite. * @property {Expectation[]} failedExpectations - The list of expectations that failed in an {@link afterAll} for this suite. diff --git a/src/core/Spec.js b/src/core/Spec.js index 531e0046..f4149622 100644 --- a/src/core/Spec.js +++ b/src/core/Spec.js @@ -39,7 +39,7 @@ getJasmineRequireObj().Spec = function(j$) { /** * @typedef SpecResult - * @property {Int} id - The unique id of this spec. + * @property {String} id - The unique id of this spec. * @property {String} description - The description passed to the {@link it} that created this spec. * @property {String} fullName - The full description including all ancestors of this spec. * @property {Expectation[]} failedExpectations - The list of expectations that failed during execution of this spec. diff --git a/src/core/Suite.js b/src/core/Suite.js index 2a0c928c..449ff861 100644 --- a/src/core/Suite.js +++ b/src/core/Suite.js @@ -106,7 +106,7 @@ getJasmineRequireObj().Suite = function(j$) { Suite.prototype.reset = function() { /** * @typedef SuiteResult - * @property {Int} id - The unique id of this suite. + * @property {String} id - The unique id of this suite. * @property {String} description - The description text passed to the {@link describe} that made this suite. * @property {String} fullName - The full description including all ancestors of this suite. * @property {Expectation[]} failedExpectations - The list of expectations that failed in an {@link afterAll} for this suite. From 5e650953cde4cb373517765080f0f255816b238a Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sat, 22 Oct 2022 11:43:03 -0700 Subject: [PATCH 4/9] Added Safari 16 to supported browsers --- README.md | 2 +- lib/jasmine-core/jasmine.js | 3 ++- scripts/run-all-browsers | 1 + src/core/ClearStack.js | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1b47eb81..31e5c081 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Microsoft Edge) as well as Node. | Environment | Supported versions | |-------------------|--------------------| | Node | 12.17+, 14, 16, 18 | -| Safari | 14-15 | +| Safari | 14-16 | | Chrome | Evergreen | | Firefox | Evergreen, 91 | | Edge | Evergreen | diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index c32d9ab3..2bb7824d 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -2868,7 +2868,8 @@ getJasmineRequireObj().clearStack = function(j$) { SAFARI || j$.util.isUndefined(global.MessageChannel) /* tests */ ) { - // queueMicrotask is dramatically faster than MessageChannel in Safari. + // queueMicrotask is dramatically faster than MessageChannel in Safari, + // at least through version 16. // Some of our own integration tests provide a mock queueMicrotask in all // environments because it's simpler to mock than MessageChannel. return browserQueueMicrotaskImpl(global); diff --git a/scripts/run-all-browsers b/scripts/run-all-browsers index 6c3302c6..6e096640 100755 --- a/scripts/run-all-browsers +++ b/scripts/run-all-browsers @@ -27,6 +27,7 @@ run_browser chrome latest run_browser firefox latest run_browser firefox 102 run_browser firefox 91 +run_browser safari 16 run_browser safari 15 run_browser safari 14 run_browser MicrosoftEdge latest diff --git a/src/core/ClearStack.js b/src/core/ClearStack.js index ced9605a..3be593c4 100644 --- a/src/core/ClearStack.js +++ b/src/core/ClearStack.js @@ -80,7 +80,8 @@ getJasmineRequireObj().clearStack = function(j$) { SAFARI || j$.util.isUndefined(global.MessageChannel) /* tests */ ) { - // queueMicrotask is dramatically faster than MessageChannel in Safari. + // queueMicrotask is dramatically faster than MessageChannel in Safari, + // at least through version 16. // Some of our own integration tests provide a mock queueMicrotask in all // environments because it's simpler to mock than MessageChannel. return browserQueueMicrotaskImpl(global); From 481f1e7c5c8745091e5c794e5a94cb4e927229c7 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sat, 29 Oct 2022 14:48:32 -0700 Subject: [PATCH 5/9] Bump version to 4.5.0 --- package.json | 2 +- release_notes/4.5.0.md | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 release_notes/4.5.0.md diff --git a/package.json b/package.json index 29c3b953..3bb03006 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jasmine-core", "license": "MIT", - "version": "4.4.0", + "version": "4.5.0", "repository": { "type": "git", "url": "https://github.com/jasmine/jasmine.git" diff --git a/release_notes/4.5.0.md b/release_notes/4.5.0.md new file mode 100644 index 00000000..70b81564 --- /dev/null +++ b/release_notes/4.5.0.md @@ -0,0 +1,40 @@ +# Jasmine 4.5.0 Release Notes + +## New Features + +* Added Safari 16 to supported browsers +* Include inner exceptions in stack traces + +## Bug Fixes + +* Report exceptions thrown by a describe before any it calls +* Coerce the random string to a seed before sending it to reporters + * This fixes an error in HTMLReporter when the configured seed is a + number rather than a string, which has been allowed since 3.8.0 + +## Documentation updates + +* Fixed the jsdoc types of SuiteResult and SpecResult ids +* Replaced var with const in API doc examples +* Updated the style of the examples that are included in jasmine-core + +## Internal improvements + +* Converted TreeProcessor to async/await +* Converted ReportDispatcher to promises + +## Supported environments + +jasmine-core 4.5.0 has been tested in the following environments. + +| Environment | Supported versions | +|-------------------|--------------------| +| Node | 12.17+, 14, 16, 18 | +| Safari | 14-16 | +| Chrome | 107 | +| Firefox | 91, 102, 106 | +| Edge | 106 | + +------ + +_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_ From f8c01574e696a3cb254b3f9753965df8befeee89 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sat, 29 Oct 2022 15:26:30 -0700 Subject: [PATCH 6/9] Added Firefox 102 (current ESR) to browser list in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 31e5c081..4a59b498 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Microsoft Edge) as well as Node. | Node | 12.17+, 14, 16, 18 | | Safari | 14-16 | | Chrome | Evergreen | -| Firefox | Evergreen, 91 | +| Firefox | Evergreen, 91, 102 | | Edge | Evergreen | For evergreen browsers, each version of Jasmine is tested against the version of the browser that is available to us From cf574634b816532e56b72e1513b0ba9978c36450 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sun, 20 Nov 2022 13:56:47 -0800 Subject: [PATCH 7/9] Upgraded to new issue templates --- .github/ISSUE_TEMPLATE.md | 47 --------------- .github/bug_report.yml | 109 +++++++++++++++++++++++++++++++++++ .github/config.yml | 14 +++++ .github/feature_proposal.yml | 31 ++++++++++ .github/support_request.yml | 84 +++++++++++++++++++++++++++ 5 files changed, 238 insertions(+), 47 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/bug_report.yml create mode 100644 .github/config.yml create mode 100644 .github/feature_proposal.yml create mode 100644 .github/support_request.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 7070a58e..00000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,47 +0,0 @@ -## Are you creating an issue in the correct repository? - -- When in doubt, create an issue here. -- If you have an issue with the Jasmine docs, file an issue in the docs repo - here: https://github.com/jasmine/jasmine.github.io -- If you have an issue with TypeScript typings, start a discussion at - [DefinitelyTpyed](https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/new?category=issues-with-a-types-package) -- This repository is for the core Jasmine framework -- If you are using a test runner that wraps Jasmine, consider filing an issue with that library if appropriate: - - [Jasmine npm](https://github.com/jasmine/jasmine-npm/issues) - - [Jasmine browser runner](https://github.com/jasmine/jasmine-browser/issues) - - [Jasmine gem](https://github.com/jasmine/jasmine-gem/issues) - - [Jasmine py](https://github.com/jasmine/jasmine-py/issues) - - [Gulp Jasmine Browser](https://github.com/jasmine/gulp-jasmine-browser/issues) - - [Karma](https://github.com/karma-runner/karma/issues) - - [Grunt Contrib Jasmine](https://github.com/gruntjs/grunt-contrib-jasmine/issues) - - - -## Expected Behavior - - - -## Current Behavior - - - -## Possible Solution - - - -## Suite that reproduces the behavior (for bugs) - -```javascript -describe("sample", function() { -}); -``` -## Context - - - -## Your Environment - -* Version used: -* Environment name and version (e.g. Chrome 39, node.js 5.4): -* Operating System and version (desktop or mobile): -* Link to your project: diff --git a/.github/bug_report.yml b/.github/bug_report.yml new file mode 100644 index 00000000..9389177d --- /dev/null +++ b/.github/bug_report.yml @@ -0,0 +1,109 @@ +name: Bug Report +description: I think I've found a bug in Jasmine +labels: ["unconfirmed bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to report a bug. Please follow these steps first. + + ## Troubleshooting + Please take the time to rule out issues with your code or third party libraries before filing a bug report. If you are reporting an error, try to determine whether the error is coming from Jasmine, another library, or your own code. + + Check the [FAQ](https://jasmine.github.io/pages/faq.html) and any other relevant [documentation](https://jasmine.github.io/pages/docs_home.html) to see if your issue has already been addressed. + + ## Special troubleshooting steps for asynchronous scenarios + If the issue has to do with testing asynchronous code, please read the [async tutorial](https://jasmine.github.io/tutorials/async) and the async section of the FAQ. In particular, check for the following common errors: + + * Are you trying to write a synchronous test for asynchronous code? + * Does the test signal completion before the code under test finishes? + * Do expectations run before the code that they're trying to verify? + + ## Try the latest version of Jasmine + If at all possible, upgrade to the latest versions of `jasmine-core` and any other relevant packages (e.g. `jasmine`, `jasmine-browser-runner`). If you can't do that, please check the [release notes](https://github.com/jasmine/jasmine/tree/main/release_notes) for all newer versions to make sure that the bug hasn't already been fixed. + + ## Put together a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) + Please help us help you by creating a minimal but complete setup that demonstrates the problem. Remove any code and libraries that aren't absolutely necessary, but make sure it doesn't depend on any code you haven't included. In many cases a simple code snippet is enough. In cases involving external libraries, *especially* Karma or Angular, we're likely to need a runable Git repository or jsbin/stackblitz/etc. + + **If we can't reproduce it, we can't fix it. Bug reports without a minimal, reproducible example are very likely to be closed.** + + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps to Reproduce + placeholder: | + Example steps: + 1. Paste the example code below into `mySpec.js`. + 2. Run `npx jasmine@ mySpec.js` + validations: + required: true + - type: textarea + id: expected-behavior + attributes: + label: Expected Behavior + description: What do you think should have happened? + validations: + required: true + - type: textarea + id: actual-behavior + attributes: + label: Actual Behavior + description: What happened instead? + validations: + required: true + - type: textarea + id: code-sample + attributes: + label: Example code that reproduces the problem + description: Please include either a code snippet that reproduces the problem or a link to a repository or jsbin/stackblitz/etc containing a minimal, reproducible example as described above. + render: JavaScript + validations: + required: true + - type: textarea + id: possible-solution + attributes: + label: Possible Solution + description: This is optional, but if you have an idea for how to fix the bug we'd like to hear it. + - type: textarea + id: context + attributes: + label: Context + description: How has this issue affected you? What are you trying to accomplish? By providing context, you can help us come up with a solution that is most useful in the real world. + - type: input + id: jasmine-core-version + attributes: + label: jasmine-core version + validations: + required: true + - type: dropdown + id: repro-with-latest-core + attributes: + label: Does the problem occur with the latest version of jasmine-core? + options: + - "Yes" + - "No" + - I haven't tried + - I'm stuck on an older version + validations: + required: true + - type: textarea + id: other-versions + attributes: + label: Versions of other relevant packages + placeholder: | + jasmine-browser-runner 1.2.0 + fancy-reporter 132.4.8 + - type: input + id: browser-or-node-version + attributes: + label: Node.js or browser version + placeholder: E.g. "node 16.2.0" or "Safari 15" + validations: + required: true + - type: input + id: os + attributes: + label: Operating System + placeholder: E.g. "Windows 10", "MacOS 12.5", "MCC Interim Linux 0.99.p8" + validations: + required: true diff --git a/.github/config.yml b/.github/config.yml new file mode 100644 index 00000000..44e74eb6 --- /dev/null +++ b/.github/config.yml @@ -0,0 +1,14 @@ +blank_issues_enabled: false +contact_links: + - name: Issues with the `jasmine` CLI + url: https://github.com/jasmine/jasmine-npm/issues + about: Please create issues related to the `jasmine` package in its repository. + - name: Issues with jasmine-browser-runner + url: https://github.com/jasmine/jasmine-browser-runner/issues + about: Please create issues related to the `jasmine-browser-runner` package in its repository. + - name: Documentation issues + url: https://github.com/jasmine/jasmine.github.io/issues + about: Please create documentation issues in the docs repository. + - name: TypeScript issues + url: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions + about: Please create issues related to TypeScript compilation errors or other problems with type definitions at DefinitelyTyped. diff --git a/.github/feature_proposal.yml b/.github/feature_proposal.yml new file mode 100644 index 00000000..1975dd64 --- /dev/null +++ b/.github/feature_proposal.yml @@ -0,0 +1,31 @@ +name: Feature Proposal +description: I'd like to propose a new feature +labels: ["feature request"] +body: + - type: markdown + attributes: + value: Thanks for taking the time to propose a new feature. Although Jasmine is mostly feature complete, we're always open to hearing new ideas. + - type: textarea + id: description + attributes: + label: Feature Proposal + validations: + required: true + - type: textarea + id: context + attributes: + label: Context + description: How would this feature be useful to you? What are you trying to accomplish? By providing context, you can help us come up with a solution that is most useful in the real world. + validations: + required: true + - type: textarea + id: example + attributes: + label: Example + description: If you're proposing a new API or something similar, please show an example of how it would be used. + render: JavaScript + - type: textarea + id: other-info + attributes: + label: Other Information + description: Anything else that you think would be helpful. diff --git a/.github/support_request.yml b/.github/support_request.yml new file mode 100644 index 00000000..5ade7a7d --- /dev/null +++ b/.github/support_request.yml @@ -0,0 +1,84 @@ +name: Question or Support Request +description: I need help using Jasmine +labels: ["question"] +body: + - type: markdown + attributes: + value: | + Jasmine is supported by volunteers working in their free time. Although we're generally willing to help, we're going to ask you to put in some effort first to help us help you. + + ## Troubleshooting + Please take the time to rule out problems with your code or third party libraries before opening an issue. If you're running into an error, try to determine whether the error is coming from Jasmine, another library, or your own code. + + Check the [FAQ](https://jasmine.github.io/pages/faq.html) and any other relevant [documentation](https://jasmine.github.io/pages/docs_home.html) to see if your question has already been answered. Consider searching [Stack Overflow](https://stackoverflow.com/questions/tagged/jasmine) and past issues in this repository for related questions as well. + + ## Special troubleshooting steps for asynchronous scenarios + If the issue has to do with testing asynchronous code, please read the [async tutorial](https://jasmine.github.io/tutorials/async) and the async section of the FAQ. In particular, check for the following common errors: + + * Are you trying to write a synchronous test for asynchronous code? + * Does the test signal completion before the code under test finishes? + * Do expectations run before the code that they're trying to verify? + + ## Consider asking Angular questions in an Angular forum + + Questions like "how do I test this Angular service" are mostly about Angular, not Jasmine. You'll likely get better responses in an Angular forum. Here's a rule of thumb: If you can't demonstrate the problem without Angular, you probably have an Angular question. + + ## Try the latest version of Jasmine + If at all possible, upgrade to the latest versions of `jasmine-core` and any other relevant packages (e.g. `jasmine`, `jasmine-browser-runner`). + + ## Put together a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) + Please help us help you by creating a minimal but complete setup that demonstrates the problem. Remove any code and libraries that aren't absolutely necessary, but make sure it doesn't depend on any code you haven't included. In many cases a simple code snippet is enough. In cases involving external libraries, *especially* Karma or Angular, we're likely to need a runable Git repository or jsbin/stackblitz/etc. + + - type: textarea + id: question + attributes: + label: Your question + description: Clearly describe what you'd like help with. + validations: + required: true + - type: textarea + id: code-sample + attributes: + label: Example code that demonstrates the problem + description: Please include either a code snippet that demonstrates the problem or a link to a repository or jsbin/stackblitz/etc containing a minimal, reproducible example as described above. + render: JavaScript + validations: + required: true + - type: input + id: jasmine-core-version + attributes: + label: jasmine-core version + validations: + required: true + - type: dropdown + id: repro-with-latest-core + attributes: + label: Does the problem occur with the latest version of jasmine-core? + options: + - "Yes" + - "No" + - I haven't tried + - I'm stuck on an older version + validations: + required: true + - type: textarea + id: other-versions + attributes: + label: Versions of other relevant packages + placeholder: | + jasmine-browser-runner 1.2.0 + fancy-reporter 132.4.8 + - type: input + id: browser-or-node-version + attributes: + label: Node.js or browser version + placeholder: E.g. "node 16.2.0" or "Safari 15" + validations: + required: true + - type: input + id: os + attributes: + label: Operating System + placeholder: E.g. "Windows 10", "MacOS 12.5", "MCC Interim Linux 0.99.p8" + validations: + required: true From b267029301cab5e593ab51cf9c3f056573e54c58 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sun, 20 Nov 2022 13:58:20 -0800 Subject: [PATCH 8/9] Revert "Upgraded to new issue templates" This reverts commit cf574634b816532e56b72e1513b0ba9978c36450. --- .github/ISSUE_TEMPLATE.md | 47 +++++++++++++++ .github/bug_report.yml | 109 ----------------------------------- .github/config.yml | 14 ----- .github/feature_proposal.yml | 31 ---------- .github/support_request.yml | 84 --------------------------- 5 files changed, 47 insertions(+), 238 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md delete mode 100644 .github/bug_report.yml delete mode 100644 .github/config.yml delete mode 100644 .github/feature_proposal.yml delete mode 100644 .github/support_request.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..7070a58e --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,47 @@ +## Are you creating an issue in the correct repository? + +- When in doubt, create an issue here. +- If you have an issue with the Jasmine docs, file an issue in the docs repo + here: https://github.com/jasmine/jasmine.github.io +- If you have an issue with TypeScript typings, start a discussion at + [DefinitelyTpyed](https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/new?category=issues-with-a-types-package) +- This repository is for the core Jasmine framework +- If you are using a test runner that wraps Jasmine, consider filing an issue with that library if appropriate: + - [Jasmine npm](https://github.com/jasmine/jasmine-npm/issues) + - [Jasmine browser runner](https://github.com/jasmine/jasmine-browser/issues) + - [Jasmine gem](https://github.com/jasmine/jasmine-gem/issues) + - [Jasmine py](https://github.com/jasmine/jasmine-py/issues) + - [Gulp Jasmine Browser](https://github.com/jasmine/gulp-jasmine-browser/issues) + - [Karma](https://github.com/karma-runner/karma/issues) + - [Grunt Contrib Jasmine](https://github.com/gruntjs/grunt-contrib-jasmine/issues) + + + +## Expected Behavior + + + +## Current Behavior + + + +## Possible Solution + + + +## Suite that reproduces the behavior (for bugs) + +```javascript +describe("sample", function() { +}); +``` +## Context + + + +## Your Environment + +* Version used: +* Environment name and version (e.g. Chrome 39, node.js 5.4): +* Operating System and version (desktop or mobile): +* Link to your project: diff --git a/.github/bug_report.yml b/.github/bug_report.yml deleted file mode 100644 index 9389177d..00000000 --- a/.github/bug_report.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Bug Report -description: I think I've found a bug in Jasmine -labels: ["unconfirmed bug"] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to report a bug. Please follow these steps first. - - ## Troubleshooting - Please take the time to rule out issues with your code or third party libraries before filing a bug report. If you are reporting an error, try to determine whether the error is coming from Jasmine, another library, or your own code. - - Check the [FAQ](https://jasmine.github.io/pages/faq.html) and any other relevant [documentation](https://jasmine.github.io/pages/docs_home.html) to see if your issue has already been addressed. - - ## Special troubleshooting steps for asynchronous scenarios - If the issue has to do with testing asynchronous code, please read the [async tutorial](https://jasmine.github.io/tutorials/async) and the async section of the FAQ. In particular, check for the following common errors: - - * Are you trying to write a synchronous test for asynchronous code? - * Does the test signal completion before the code under test finishes? - * Do expectations run before the code that they're trying to verify? - - ## Try the latest version of Jasmine - If at all possible, upgrade to the latest versions of `jasmine-core` and any other relevant packages (e.g. `jasmine`, `jasmine-browser-runner`). If you can't do that, please check the [release notes](https://github.com/jasmine/jasmine/tree/main/release_notes) for all newer versions to make sure that the bug hasn't already been fixed. - - ## Put together a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) - Please help us help you by creating a minimal but complete setup that demonstrates the problem. Remove any code and libraries that aren't absolutely necessary, but make sure it doesn't depend on any code you haven't included. In many cases a simple code snippet is enough. In cases involving external libraries, *especially* Karma or Angular, we're likely to need a runable Git repository or jsbin/stackblitz/etc. - - **If we can't reproduce it, we can't fix it. Bug reports without a minimal, reproducible example are very likely to be closed.** - - - type: textarea - id: steps-to-reproduce - attributes: - label: Steps to Reproduce - placeholder: | - Example steps: - 1. Paste the example code below into `mySpec.js`. - 2. Run `npx jasmine@ mySpec.js` - validations: - required: true - - type: textarea - id: expected-behavior - attributes: - label: Expected Behavior - description: What do you think should have happened? - validations: - required: true - - type: textarea - id: actual-behavior - attributes: - label: Actual Behavior - description: What happened instead? - validations: - required: true - - type: textarea - id: code-sample - attributes: - label: Example code that reproduces the problem - description: Please include either a code snippet that reproduces the problem or a link to a repository or jsbin/stackblitz/etc containing a minimal, reproducible example as described above. - render: JavaScript - validations: - required: true - - type: textarea - id: possible-solution - attributes: - label: Possible Solution - description: This is optional, but if you have an idea for how to fix the bug we'd like to hear it. - - type: textarea - id: context - attributes: - label: Context - description: How has this issue affected you? What are you trying to accomplish? By providing context, you can help us come up with a solution that is most useful in the real world. - - type: input - id: jasmine-core-version - attributes: - label: jasmine-core version - validations: - required: true - - type: dropdown - id: repro-with-latest-core - attributes: - label: Does the problem occur with the latest version of jasmine-core? - options: - - "Yes" - - "No" - - I haven't tried - - I'm stuck on an older version - validations: - required: true - - type: textarea - id: other-versions - attributes: - label: Versions of other relevant packages - placeholder: | - jasmine-browser-runner 1.2.0 - fancy-reporter 132.4.8 - - type: input - id: browser-or-node-version - attributes: - label: Node.js or browser version - placeholder: E.g. "node 16.2.0" or "Safari 15" - validations: - required: true - - type: input - id: os - attributes: - label: Operating System - placeholder: E.g. "Windows 10", "MacOS 12.5", "MCC Interim Linux 0.99.p8" - validations: - required: true diff --git a/.github/config.yml b/.github/config.yml deleted file mode 100644 index 44e74eb6..00000000 --- a/.github/config.yml +++ /dev/null @@ -1,14 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Issues with the `jasmine` CLI - url: https://github.com/jasmine/jasmine-npm/issues - about: Please create issues related to the `jasmine` package in its repository. - - name: Issues with jasmine-browser-runner - url: https://github.com/jasmine/jasmine-browser-runner/issues - about: Please create issues related to the `jasmine-browser-runner` package in its repository. - - name: Documentation issues - url: https://github.com/jasmine/jasmine.github.io/issues - about: Please create documentation issues in the docs repository. - - name: TypeScript issues - url: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions - about: Please create issues related to TypeScript compilation errors or other problems with type definitions at DefinitelyTyped. diff --git a/.github/feature_proposal.yml b/.github/feature_proposal.yml deleted file mode 100644 index 1975dd64..00000000 --- a/.github/feature_proposal.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Feature Proposal -description: I'd like to propose a new feature -labels: ["feature request"] -body: - - type: markdown - attributes: - value: Thanks for taking the time to propose a new feature. Although Jasmine is mostly feature complete, we're always open to hearing new ideas. - - type: textarea - id: description - attributes: - label: Feature Proposal - validations: - required: true - - type: textarea - id: context - attributes: - label: Context - description: How would this feature be useful to you? What are you trying to accomplish? By providing context, you can help us come up with a solution that is most useful in the real world. - validations: - required: true - - type: textarea - id: example - attributes: - label: Example - description: If you're proposing a new API or something similar, please show an example of how it would be used. - render: JavaScript - - type: textarea - id: other-info - attributes: - label: Other Information - description: Anything else that you think would be helpful. diff --git a/.github/support_request.yml b/.github/support_request.yml deleted file mode 100644 index 5ade7a7d..00000000 --- a/.github/support_request.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Question or Support Request -description: I need help using Jasmine -labels: ["question"] -body: - - type: markdown - attributes: - value: | - Jasmine is supported by volunteers working in their free time. Although we're generally willing to help, we're going to ask you to put in some effort first to help us help you. - - ## Troubleshooting - Please take the time to rule out problems with your code or third party libraries before opening an issue. If you're running into an error, try to determine whether the error is coming from Jasmine, another library, or your own code. - - Check the [FAQ](https://jasmine.github.io/pages/faq.html) and any other relevant [documentation](https://jasmine.github.io/pages/docs_home.html) to see if your question has already been answered. Consider searching [Stack Overflow](https://stackoverflow.com/questions/tagged/jasmine) and past issues in this repository for related questions as well. - - ## Special troubleshooting steps for asynchronous scenarios - If the issue has to do with testing asynchronous code, please read the [async tutorial](https://jasmine.github.io/tutorials/async) and the async section of the FAQ. In particular, check for the following common errors: - - * Are you trying to write a synchronous test for asynchronous code? - * Does the test signal completion before the code under test finishes? - * Do expectations run before the code that they're trying to verify? - - ## Consider asking Angular questions in an Angular forum - - Questions like "how do I test this Angular service" are mostly about Angular, not Jasmine. You'll likely get better responses in an Angular forum. Here's a rule of thumb: If you can't demonstrate the problem without Angular, you probably have an Angular question. - - ## Try the latest version of Jasmine - If at all possible, upgrade to the latest versions of `jasmine-core` and any other relevant packages (e.g. `jasmine`, `jasmine-browser-runner`). - - ## Put together a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) - Please help us help you by creating a minimal but complete setup that demonstrates the problem. Remove any code and libraries that aren't absolutely necessary, but make sure it doesn't depend on any code you haven't included. In many cases a simple code snippet is enough. In cases involving external libraries, *especially* Karma or Angular, we're likely to need a runable Git repository or jsbin/stackblitz/etc. - - - type: textarea - id: question - attributes: - label: Your question - description: Clearly describe what you'd like help with. - validations: - required: true - - type: textarea - id: code-sample - attributes: - label: Example code that demonstrates the problem - description: Please include either a code snippet that demonstrates the problem or a link to a repository or jsbin/stackblitz/etc containing a minimal, reproducible example as described above. - render: JavaScript - validations: - required: true - - type: input - id: jasmine-core-version - attributes: - label: jasmine-core version - validations: - required: true - - type: dropdown - id: repro-with-latest-core - attributes: - label: Does the problem occur with the latest version of jasmine-core? - options: - - "Yes" - - "No" - - I haven't tried - - I'm stuck on an older version - validations: - required: true - - type: textarea - id: other-versions - attributes: - label: Versions of other relevant packages - placeholder: | - jasmine-browser-runner 1.2.0 - fancy-reporter 132.4.8 - - type: input - id: browser-or-node-version - attributes: - label: Node.js or browser version - placeholder: E.g. "node 16.2.0" or "Safari 15" - validations: - required: true - - type: input - id: os - attributes: - label: Operating System - placeholder: E.g. "Windows 10", "MacOS 12.5", "MCC Interim Linux 0.99.p8" - validations: - required: true From 169a2a8ad23a7e5cb12be0a2df02ea4337b9811a Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sun, 20 Nov 2022 14:01:43 -0800 Subject: [PATCH 9/9] Upgraded to new issue templates --- .github/ISSUE_TEMPLATE.md | 47 --------- .github/ISSUE_TEMPLATE/bug_report.yml | 109 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 14 +++ .github/ISSUE_TEMPLATE/feature_proposal.yml | 31 ++++++ .github/ISSUE_TEMPLATE/support_request.yml | 84 +++++++++++++++ 5 files changed, 238 insertions(+), 47 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_proposal.yml create mode 100644 .github/ISSUE_TEMPLATE/support_request.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 7070a58e..00000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,47 +0,0 @@ -## Are you creating an issue in the correct repository? - -- When in doubt, create an issue here. -- If you have an issue with the Jasmine docs, file an issue in the docs repo - here: https://github.com/jasmine/jasmine.github.io -- If you have an issue with TypeScript typings, start a discussion at - [DefinitelyTpyed](https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/new?category=issues-with-a-types-package) -- This repository is for the core Jasmine framework -- If you are using a test runner that wraps Jasmine, consider filing an issue with that library if appropriate: - - [Jasmine npm](https://github.com/jasmine/jasmine-npm/issues) - - [Jasmine browser runner](https://github.com/jasmine/jasmine-browser/issues) - - [Jasmine gem](https://github.com/jasmine/jasmine-gem/issues) - - [Jasmine py](https://github.com/jasmine/jasmine-py/issues) - - [Gulp Jasmine Browser](https://github.com/jasmine/gulp-jasmine-browser/issues) - - [Karma](https://github.com/karma-runner/karma/issues) - - [Grunt Contrib Jasmine](https://github.com/gruntjs/grunt-contrib-jasmine/issues) - - - -## Expected Behavior - - - -## Current Behavior - - - -## Possible Solution - - - -## Suite that reproduces the behavior (for bugs) - -```javascript -describe("sample", function() { -}); -``` -## Context - - - -## Your Environment - -* Version used: -* Environment name and version (e.g. Chrome 39, node.js 5.4): -* Operating System and version (desktop or mobile): -* Link to your project: diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..9389177d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,109 @@ +name: Bug Report +description: I think I've found a bug in Jasmine +labels: ["unconfirmed bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to report a bug. Please follow these steps first. + + ## Troubleshooting + Please take the time to rule out issues with your code or third party libraries before filing a bug report. If you are reporting an error, try to determine whether the error is coming from Jasmine, another library, or your own code. + + Check the [FAQ](https://jasmine.github.io/pages/faq.html) and any other relevant [documentation](https://jasmine.github.io/pages/docs_home.html) to see if your issue has already been addressed. + + ## Special troubleshooting steps for asynchronous scenarios + If the issue has to do with testing asynchronous code, please read the [async tutorial](https://jasmine.github.io/tutorials/async) and the async section of the FAQ. In particular, check for the following common errors: + + * Are you trying to write a synchronous test for asynchronous code? + * Does the test signal completion before the code under test finishes? + * Do expectations run before the code that they're trying to verify? + + ## Try the latest version of Jasmine + If at all possible, upgrade to the latest versions of `jasmine-core` and any other relevant packages (e.g. `jasmine`, `jasmine-browser-runner`). If you can't do that, please check the [release notes](https://github.com/jasmine/jasmine/tree/main/release_notes) for all newer versions to make sure that the bug hasn't already been fixed. + + ## Put together a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) + Please help us help you by creating a minimal but complete setup that demonstrates the problem. Remove any code and libraries that aren't absolutely necessary, but make sure it doesn't depend on any code you haven't included. In many cases a simple code snippet is enough. In cases involving external libraries, *especially* Karma or Angular, we're likely to need a runable Git repository or jsbin/stackblitz/etc. + + **If we can't reproduce it, we can't fix it. Bug reports without a minimal, reproducible example are very likely to be closed.** + + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps to Reproduce + placeholder: | + Example steps: + 1. Paste the example code below into `mySpec.js`. + 2. Run `npx jasmine@ mySpec.js` + validations: + required: true + - type: textarea + id: expected-behavior + attributes: + label: Expected Behavior + description: What do you think should have happened? + validations: + required: true + - type: textarea + id: actual-behavior + attributes: + label: Actual Behavior + description: What happened instead? + validations: + required: true + - type: textarea + id: code-sample + attributes: + label: Example code that reproduces the problem + description: Please include either a code snippet that reproduces the problem or a link to a repository or jsbin/stackblitz/etc containing a minimal, reproducible example as described above. + render: JavaScript + validations: + required: true + - type: textarea + id: possible-solution + attributes: + label: Possible Solution + description: This is optional, but if you have an idea for how to fix the bug we'd like to hear it. + - type: textarea + id: context + attributes: + label: Context + description: How has this issue affected you? What are you trying to accomplish? By providing context, you can help us come up with a solution that is most useful in the real world. + - type: input + id: jasmine-core-version + attributes: + label: jasmine-core version + validations: + required: true + - type: dropdown + id: repro-with-latest-core + attributes: + label: Does the problem occur with the latest version of jasmine-core? + options: + - "Yes" + - "No" + - I haven't tried + - I'm stuck on an older version + validations: + required: true + - type: textarea + id: other-versions + attributes: + label: Versions of other relevant packages + placeholder: | + jasmine-browser-runner 1.2.0 + fancy-reporter 132.4.8 + - type: input + id: browser-or-node-version + attributes: + label: Node.js or browser version + placeholder: E.g. "node 16.2.0" or "Safari 15" + validations: + required: true + - type: input + id: os + attributes: + label: Operating System + placeholder: E.g. "Windows 10", "MacOS 12.5", "MCC Interim Linux 0.99.p8" + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..44e74eb6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,14 @@ +blank_issues_enabled: false +contact_links: + - name: Issues with the `jasmine` CLI + url: https://github.com/jasmine/jasmine-npm/issues + about: Please create issues related to the `jasmine` package in its repository. + - name: Issues with jasmine-browser-runner + url: https://github.com/jasmine/jasmine-browser-runner/issues + about: Please create issues related to the `jasmine-browser-runner` package in its repository. + - name: Documentation issues + url: https://github.com/jasmine/jasmine.github.io/issues + about: Please create documentation issues in the docs repository. + - name: TypeScript issues + url: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions + about: Please create issues related to TypeScript compilation errors or other problems with type definitions at DefinitelyTyped. diff --git a/.github/ISSUE_TEMPLATE/feature_proposal.yml b/.github/ISSUE_TEMPLATE/feature_proposal.yml new file mode 100644 index 00000000..1975dd64 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_proposal.yml @@ -0,0 +1,31 @@ +name: Feature Proposal +description: I'd like to propose a new feature +labels: ["feature request"] +body: + - type: markdown + attributes: + value: Thanks for taking the time to propose a new feature. Although Jasmine is mostly feature complete, we're always open to hearing new ideas. + - type: textarea + id: description + attributes: + label: Feature Proposal + validations: + required: true + - type: textarea + id: context + attributes: + label: Context + description: How would this feature be useful to you? What are you trying to accomplish? By providing context, you can help us come up with a solution that is most useful in the real world. + validations: + required: true + - type: textarea + id: example + attributes: + label: Example + description: If you're proposing a new API or something similar, please show an example of how it would be used. + render: JavaScript + - type: textarea + id: other-info + attributes: + label: Other Information + description: Anything else that you think would be helpful. diff --git a/.github/ISSUE_TEMPLATE/support_request.yml b/.github/ISSUE_TEMPLATE/support_request.yml new file mode 100644 index 00000000..5ade7a7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.yml @@ -0,0 +1,84 @@ +name: Question or Support Request +description: I need help using Jasmine +labels: ["question"] +body: + - type: markdown + attributes: + value: | + Jasmine is supported by volunteers working in their free time. Although we're generally willing to help, we're going to ask you to put in some effort first to help us help you. + + ## Troubleshooting + Please take the time to rule out problems with your code or third party libraries before opening an issue. If you're running into an error, try to determine whether the error is coming from Jasmine, another library, or your own code. + + Check the [FAQ](https://jasmine.github.io/pages/faq.html) and any other relevant [documentation](https://jasmine.github.io/pages/docs_home.html) to see if your question has already been answered. Consider searching [Stack Overflow](https://stackoverflow.com/questions/tagged/jasmine) and past issues in this repository for related questions as well. + + ## Special troubleshooting steps for asynchronous scenarios + If the issue has to do with testing asynchronous code, please read the [async tutorial](https://jasmine.github.io/tutorials/async) and the async section of the FAQ. In particular, check for the following common errors: + + * Are you trying to write a synchronous test for asynchronous code? + * Does the test signal completion before the code under test finishes? + * Do expectations run before the code that they're trying to verify? + + ## Consider asking Angular questions in an Angular forum + + Questions like "how do I test this Angular service" are mostly about Angular, not Jasmine. You'll likely get better responses in an Angular forum. Here's a rule of thumb: If you can't demonstrate the problem without Angular, you probably have an Angular question. + + ## Try the latest version of Jasmine + If at all possible, upgrade to the latest versions of `jasmine-core` and any other relevant packages (e.g. `jasmine`, `jasmine-browser-runner`). + + ## Put together a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) + Please help us help you by creating a minimal but complete setup that demonstrates the problem. Remove any code and libraries that aren't absolutely necessary, but make sure it doesn't depend on any code you haven't included. In many cases a simple code snippet is enough. In cases involving external libraries, *especially* Karma or Angular, we're likely to need a runable Git repository or jsbin/stackblitz/etc. + + - type: textarea + id: question + attributes: + label: Your question + description: Clearly describe what you'd like help with. + validations: + required: true + - type: textarea + id: code-sample + attributes: + label: Example code that demonstrates the problem + description: Please include either a code snippet that demonstrates the problem or a link to a repository or jsbin/stackblitz/etc containing a minimal, reproducible example as described above. + render: JavaScript + validations: + required: true + - type: input + id: jasmine-core-version + attributes: + label: jasmine-core version + validations: + required: true + - type: dropdown + id: repro-with-latest-core + attributes: + label: Does the problem occur with the latest version of jasmine-core? + options: + - "Yes" + - "No" + - I haven't tried + - I'm stuck on an older version + validations: + required: true + - type: textarea + id: other-versions + attributes: + label: Versions of other relevant packages + placeholder: | + jasmine-browser-runner 1.2.0 + fancy-reporter 132.4.8 + - type: input + id: browser-or-node-version + attributes: + label: Node.js or browser version + placeholder: E.g. "node 16.2.0" or "Safari 15" + validations: + required: true + - type: input + id: os + attributes: + label: Operating System + placeholder: E.g. "Windows 10", "MacOS 12.5", "MCC Interim Linux 0.99.p8" + validations: + required: true