poorejc commented on pull request #46: URL: https://github.com/apache/incubator-flagon-useralejs/pull/46#issuecomment-793405892
Hi @UncleGedd thanks again for the work. I tested this tonight, and I'm afraid I found a bug in unit tests that traces back to your last PR. The error is in https://github.com/apache/incubator-flagon-useralejs/blob/395270fb683332f4ac75ade35d6ccb6e9beea78a/test/getInitialSettings_spec.js#L80 Looks like this: getInitialSettings ✓ fetches all settings from a script tag (164ms) Error: Could not load script: "file://./build/userale-2.1.1.min.js" The test output looks like this: 1) getInitialSettings getInitialSettings grabs user id from params: TypeError: Cannot read property 'options' of undefined at _callee2$ (test/getInitialSettings_spec.js:82:47) at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40) at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:293:22) at Generator.next (node_modules/regenerator-runtime/runtime.js:118:21) at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9) I found this after dumping package-lock and regenerating through 'npm install' (not sure how I missed this in testing... apologies). Tests execute as written with the package-lock intact following your push. But, regenerating package-lock from our package.json breaks this one unit test. Could be you had additional npm modules loaded locally that were built into the package-lock. I confirmed by regression testing against your PR commit: git checkout 85b0219d1b4a01ea59e09ca757e27b84cce6b414 Looks like the url passed into this particular test doesn't pull the right resource (script). https://github.com/apache/incubator-flagon-useralejs/blob/395270fb683332f4ac75ade35d6ccb6e9beea78a/test/getInitialSettings_spec.js#L80 Previously we had configured this test to run against a URL with external assets (localhost:8080), not the (userale) script file path itself. https://github.com/apache/incubator-flagon-useralejs/blob/b6d62f8c7c817a065ba9577b9b0909efeb681b7f/test/testUtils.js#L47' Then again, it seems that some delta between your npm modules and the ones called through our package.json makes this run... I mucked about with the url configs to point at "file://../build/userale-2.1.1.min.js", and maybe find a workaroud, but test still fails. Giving up on it tonight as I'm struggling to find good examples of usage for this config in JSDOM literature. If you have a moment and can look into it on your end see if it occurs to you if there is a package that you forgot to add to package.json... that would be much appreciated--then can commit back into this PR request and I'll test again tomorrow night. Thanks! ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
