Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: givens: given must be called inside a describe in #46

Open
vjustov opened this issue Nov 19, 2021 · 2 comments · May be fixed by #47
Open

Error: givens: given must be called inside a describe in #46

vjustov opened this issue Nov 19, 2021 · 2 comments · May be fixed by #47

Comments

@vjustov
Copy link

vjustov commented Nov 19, 2021

Hello, I'm working on an angular project that is using jasmine through karma,
when i try to use givens i get the error in the title.
by changing the regex that are used to evaluate the context to: /(jasmine\\.js|jasmine\/lib\/loader\.js)/ and /Env\.describe|Env\/this.describe/ respectively the test seems to work.

getContextInfo@http://localhost:9876/_karma_webpack_/vendor.js:137425:21
given@http://localhost:9876/_karma_webpack_/vendor.js:137493:46
88403/</<@http://localhost:9876/_karma_webpack_/main.js:8172:14
32600/</ZoneDelegate.prototype.invoke@http://localhost:9876/_karma_webpack_/polyfills.js:414:30
32600/</Zone.prototype.run@http://localhost:9876/_karma_webpack_/polyfills.js:174:47
wrapDescribeInZone/<@http://localhost:9876/_karma_webpack_/vendor.js:169990:33
addSpecsToSuite@http://localhost:9876/absolute/Users/vjustov/some-project/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?b9e399d056ab3608dfb7a9a60a397876081d58cd:1991:25
Env/this.describe@http://localhost:9876/absolute/Users/vjustov/some-project/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?b9e399d056ab3608dfb7a9a60a397876081d58cd:1956:22
58991/</</</jasmineEnv[methodName]@http://localhost:9876/_karma_webpack_/vendor.js:169895:42
describe@http://localhost:9876/absolute/Users/vjustov/some-project/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?b9e399d056ab3608dfb7a9a60a397876081d58cd:7727:18
88403/<@http://localhost:9876/_karma_webpack_/main.js:8170:13
32600/</ZoneDelegate.prototype.invoke@http://localhost:9876/_karma_webpack_/polyfills.js:414:30
32600/</Zone.prototype.run@http://localhost:9876/_karma_webpack_/polyfills.js:174:47
wrapDescribeInZone/<@http://localhost:9876/_karma_webpack_/vendor.js:169990:33
addSpecsToSuite@http://localhost:9876/absolute/Users/vjustov/some-project/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?b9e399d056ab3608dfb7a9a60a397876081d58cd:1991:25
Env/this.fdescribe@http://localhost:9876/absolute/Users/vjustov/some-project/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?b9e399d056ab3608dfb7a9a60a397876081d58cd:1979:22
58991/</</</jasmineEnv[methodName]@http://localhost:9876/_karma_webpack_/vendor.js:169895:42
fdescribe@http://localhost:9876/absolute/Users/vjustov/some-project/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?b9e399d056ab3608dfb7a9a60a397876081d58cd:7758:18
88403@http://localhost:9876/_karma_webpack_/main.js:8169:10
__webpack_require__@http://localhost:9876/_karma_webpack_/main.js:16424:42
webpackContext@http://localhost:9876/_karma_webpack_/main.js:16363:9
74097@http://localhost:9876/_karma_webpack_/main.js:10434:16
__webpack_require__@http://localhost:9876/_karma_webpack_/main.js:16424:42
__webpack_exports__<@http://localhost:9876/_karma_webpack_/main.js:16745:102
__webpack_require__.O@http://localhost:9876/_karma_webpack_/main.js:16463:23
@http://localhost:9876/_karma_webpack_/main.js:16746:53
@http://localhost:9876/_karma_webpack_/main.js:16748:12

I am trying to provide a greenfield sandbox to replicate the bug, but so far haven't been able

@maboesanman
Copy link
Collaborator

is this project open source? if so could you provide a repo? non-minimal example is potentially fine as long as its reproducible

@maboesanman
Copy link
Collaborator

can you confirm whether using only modifying the value checking Env works?

the first one determines if the runner is jasmine, and if it can't figure it out it avoids blocking.
the second one determines if the current call stack is inside a describe.

I would like to create some sort of minimal integration test for this use case, but for now I believe your second regex should do the trick, if you could confirm for me

@maboesanman maboesanman linked a pull request Nov 20, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants