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

Test @example in TurfJS core #859

Closed
5 tasks done
DenisCarriere opened this issue Jul 22, 2017 · 4 comments
Closed
5 tasks done

Test @example in TurfJS core #859

DenisCarriere opened this issue Jul 22, 2017 · 4 comments
Assignees
Milestone

Comments

@DenisCarriere
Copy link
Member

DenisCarriere commented Jul 22, 2017

Test @example in TurfJS core

Going to start testing the @example directly in TurfJS core, that way we don't have switch back and forth between turf-www & turf. Used/updated the existing code that was being used in turf-www/test/build.js.

How to use

$ cd turf/packages/turf
$ npm test
$ node test.example.js

To-Do

Quite a few already - can use this PR #857

once all the errors are fixed

  • Add DocumentationJS linting

same as turf-www => lintAPI

the turf-www repo will only focus on building the website and not be used for validation or linting

This was suppose to be a PR and not pushed directly to master "Commit 46756c2" (thought I disabled that - guess not 😝)

CC: @stebogit @rowanwins @tmcw @morganherlocker

@stebogit
Copy link
Collaborator

the turf-www repo will only focus on building the website and not be used for validation or linting

👍 👍 @DenisCarriere

@stebogit stebogit mentioned this issue Jul 24, 2017
@stebogit
Copy link
Collaborator

stebogit commented Jul 27, 2017

  • Add DocumentationJS linting

@DenisCarriere should I just add

"test": "npm run lint && lerna bootstrap && tap packages/*/test.js && npm run types && npm run lintAPI",
"lintAPI": "documentation lint turf/packages/turf-*/index.js",

turf/package.json?

EDIT: I tryed and it works only if ran directly (npm run lintAPI); otherwise it is not executed. Is it ok adding it at the end of the other tests?
BTW the unkink complex.json test fails, might that be a reason why the lintAPI test is not executed when run npm test?

@DenisCarriere
Copy link
Member Author

👍 We should include this documentation linting.

@stebogit we can also use the post/pre to run our scripts, this will chain the npm scripts.

"lint": "eslint packages",
"postlint": "documentation lint packages/turf-*/index.js",

I'm getting warnings (which = as errors in TravisCI), but these seem pretty easy to fix.

$ npm run lint

> @4.0.0 lint /Users/mac/Github/turf
> eslint packages


> @4.0.0 postlint /Users/mac/Github/turf
> documentation lint packages/turf-*/index.js

/Users/mac/Github/turf/packages/turf-bbox-polygon/index.js
        9:1  warning  unknown tag @addToMap

/Users/mac/Github/turf/packages/turf-boolean-contains/index.js
      220:1  warning  type Boolean found, boolean is standard

/Users/mac/Github/turf/packages/turf-boolean-crosses/index.js
      146:1  warning  type Boolean found, boolean is standard

/Users/mac/Github/turf/packages/turf-boolean-point-on-line/index.js
       38:1  warning  type String found, string is standard

/Users/mac/Github/turf/packages/turf-meta/index.js
      468:1  warning  type object found, Object is standard
      741:1  warning  unknown tag @turf
      760:1  warning  unknown tag @turf

/Users/mac/Github/turf/packages/turf-square/index.js
       10:1  warning  unknown tag @addToMap

⚠ 8 warnings

DenisCarriere added a commit that referenced this issue Jul 27, 2017
DenisCarriere added a commit to Turfjs/turf-www that referenced this issue Aug 2, 2017
Now implemented in TurfJS Core
Ref: Turfjs/turf#859
@DenisCarriere
Copy link
Member Author

Finally dropped all tests & linting from turf-www since it's implemented directly in TurfJS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants