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

remove coverage/, dist/ and types/ from version control #3

Closed
wants to merge 1 commit into from

Conversation

jgravois
Copy link
Contributor

@jgravois jgravois commented Oct 17, 2018

the tweaks here make it a little clearer that karma isn't currently actually running any of the tests. can you pull down this branch and run npm test to confirm that you're seeing the same thing?

john6251 at Frink in ~/github/arcgis-clone-js on karma
$ npm test

> arcgis-clone-js@0.2.0 test /Users/john6251/github/arcgis-clone-js
> karma start --single-run --browsers=Chrome

17 10 2018 15:57:58.691:INFO [compiler.karma-typescript]: Compiling project using Typescript 2.9.2
17 10 2018 15:58:00.955:INFO [compiler.karma-typescript]: Compiled 19 files in 2236 ms.
17 10 2018 15:58:01.943:INFO [karma]: Karma v2.0.5 server started at http://0.0.0.0:9876/
17 10 2018 15:58:01.945:INFO [launcher]: Launching browser Chrome with unlimited concurrency
17 10 2018 15:58:01.950:INFO [launcher]: Starting browser Chrome
17 10 2018 15:58:03.340:INFO [Chrome 70.0.3538 (Mac OS X 10.13.6)]: Connected on socket Mbw3hhqvzzwND6mZAAAA with id 65661847
Chrome 70.0.3538 (Mac OS X 10.13.6): Executed 0 of 0 ERROR (0.001 secs / 0 secs)
npm ERR! Test failed.  See above for more details.

i screwed around with tsc and karma-typescript a bit but i haven't been able to figure out why yet.

to do:

  • npm test runs karma in --single-run mode in chrome only
  • figure out why karma can't run the test suite
  • add the coverage reporter
  • turn on coveralls

@MikeTschudi
Copy link
Member

@jgravois, don't know why I closed this.

When I use the karma branch and its OO form of the work, I get the following message when I run npm test:

> arcgis-clone-js@0.2.0 test C:\Users\mike6491\ag\arcgis-clone-js
> karma start --single-run --browsers=Chrome

05 11 2018 15:33:10.718:INFO [compiler.karma-typescript]: Compiling project using Typescript 2.9.2
05 11 2018 15:33:13.658:INFO [compiler.karma-typescript]: Compiled 19 files in 2862 ms.
05 11 2018 15:33:14.727:INFO [karma]: Karma v2.0.5 server started at http://0.0.0.0:9876/
05 11 2018 15:33:14.727:INFO [launcher]: Launching browser Chrome with unlimited concurrency
05 11 2018 15:33:14.743:INFO [launcher]: Starting browser Chrome
05 11 2018 15:33:16.166:INFO [Chrome 70.0.3538 (Windows 10 0.0.0)]: Connected on socket oAcra-Teo9WUcYsFAAAA with id 71664576
Chrome 70.0.3538 (Windows 10 0.0.0): Executed 0 of 0 ERROR (0.002 secs / 0 secs)
npm ERR! Test failed.  See above for more details.

I copied changes in the karma branch into a branch off of the functional form of the work (functional-coverage). This branch uses a later TypeScript; I get the following message when I run npm test:

> arcgis-clone-js@0.2.0 test C:\Users\mike6491\ag\arcgis-clone-js
> karma start --single-run --browsers=Chrome

05 11 2018 15:20:35.364:INFO [compiler.karma-typescript]: Compiling project using Typescript 3.1.2
05 11 2018 15:20:38.216:INFO [compiler.karma-typescript]: Compiled 15 files in 2747 ms.
05 11 2018 15:20:39.355:INFO [karma-server]: Karma v3.1.1 server started at http://0.0.0.0:9876/
05 11 2018 15:20:39.357:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
05 11 2018 15:20:39.450:INFO [launcher]: Starting browser Chrome
05 11 2018 15:20:40.891:INFO [Chrome 70.0.3538 (Windows 10 0.0.0)]: Connected on socket iOliN0bU_gHj4sxeAAAA with id 16999942
Chrome 70.0.3538 (Windows 10 0.0.0): Executed 0 of 0 ERROR (0.049 secs / 0 secs)
npm ERR! Test failed.  See above for more details.

npm run test:node works for both branches.

So I can verify that karma isn't running tests. :-/

@MikeTschudi
Copy link
Member

It appears that tests and coverage are running in branch functional-coverage!

There's one catch: there's a runtime error referencing @esri/arcgis-rest-common-types:

> arcgis-clone-js@0.2.0 test C:\Users\mike6491\ag\arcgis-clone-js
> karma start --single-run --browsers=Chrome

07 11 2018 12:15:58.106:INFO [compiler.karma-typescript]: Compiling project using Typescript 3.1.2
07 11 2018 12:16:01.150:INFO [compiler.karma-typescript]: Compiled 15 files in 2935 ms.
07 11 2018 12:16:03.260:ERROR [karma-server]: Error: Unable to resolve module [@esri/arcgis-rest-common-types] from [C:/Users/mike6491/ag/arcgis-clone-js/src/dependencies.js]

I added bundler options to karma.conf.js to help it to find the @esri options, which presents the problem that the distribution of arcgis-rest-common-types only contains .d.ts files, and karma appears to require .js files for its alias mapping.

I was able to get it to work by creating an empty index.js file in node_modules/@esri/arcgis-rest-common-types/dist/node/ and pointing the package's alias to it.

@jgravois, is there a better alias for the package? If not, can we add an empty .js file to the arcgis-rest-js distribution for the arcgis-rest-common-types package?


Successful run with empty file; the braced area starting on the fourth line is a dump of the bundler options alias table:

> arcgis-clone-js@0.2.0 test C:\Users\mike6491\ag\arcgis-clone-js
> karma start --single-run --browsers=Chrome

{ '@esri/arcgis-rest-auth': 'node_modules/@esri/arcgis-rest-auth/dist/node/index.js',
  '@esri/arcgis-rest-common-types': 'node_modules/@esri/arcgis-rest-common-types/dist/node/index.js',
  '@esri/arcgis-rest-feature-service-admin': 'node_modules/@esri/arcgis-rest-feature-service-admin/dist/node/index.js',
  '@esri/arcgis-rest-groups': 'node_modules/@esri/arcgis-rest-groups/dist/node/index.js',
  '@esri/arcgis-rest-items': 'node_modules/@esri/arcgis-rest-items/dist/node/index.js',
  '@esri/arcgis-rest-request': 'node_modules/@esri/arcgis-rest-request/dist/node/index.js',
  '@esri/arcgis-rest-sharing': 'node_modules/@esri/arcgis-rest-sharing/dist/node/index.js' }
07 11 2018 12:33:43.639:INFO [compiler.karma-typescript]: Compiling project using Typescript 3.1.2
07 11 2018 12:33:47.005:INFO [compiler.karma-typescript]: Compiled 15 files in 3273 ms.
07 11 2018 12:33:50.891:INFO [bundler.karma-typescript]: Bundled imports for 15 file(s) in 3379 ms.
07 11 2018 12:33:51.259:INFO [karma-server]: Karma v3.1.1 server started at http://0.0.0.0:9876/
07 11 2018 12:33:51.262:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
07 11 2018 12:33:51.271:INFO [launcher]: Starting browser Chrome
07 11 2018 12:33:52.982:INFO [Chrome 70.0.3538 (Windows 10 0.0.0)]: Connected on socket RCAM8Tkkki3QXHPEAAAA with id 52509798
...............................................................
Chrome 70.0.3538 (Windows 10 0.0.0): Executed 63 of 63 SUCCESS (0.316 secs / 0.232 secs)
-----------------------|----------|----------|----------|----------|----------------|
File                   |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-----------------------|----------|----------|----------|----------|----------------|
 src\                  |    58.89 |    53.28 |    49.62 |     58.7 |                |
  dependencies.ts      |    97.12 |    73.08 |    91.18 |    97.06 |    168,364,372 |
  fullItem.ts          |       80 |       75 |       70 |       80 |... 104,109,118 |
  fullItemHierarchy.ts |    96.97 |    93.33 |      100 |    96.97 |             81 |
  index.ts             |      100 |      100 |      100 |      100 |                |
  solution.ts          |    30.17 |    18.97 |    16.67 |    30.17 |... 875,880,919 |
  viewing.ts           |      100 |     87.5 |      100 |      100 |                |
-----------------------|----------|----------|----------|----------|----------------|
All files              |    58.89 |    53.28 |    49.62 |     58.7 |                |
-----------------------|----------|----------|----------|----------|----------------|

07 11 2018 12:33:54.710:INFO [coveralls.io]: uploading...
07 11 2018 12:33:54.712:INFO [coveralls.io]: 0 --- undefined

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 this pull request may close these issues.

2 participants