-
Notifications
You must be signed in to change notification settings - Fork 676
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
Clean up npm scripts and start running tests #725
Clean up npm scripts and start running tests #725
Conversation
cc @gregg-miskelly, @chuckries I'm not intending to merge this until after we ship 1.4, but wanted to get this out there to get your thoughts. |
dd33ed8
to
489962b
Compare
|
I suggest adding an |
I also vote for chai.js as the assert library of choice (if a vote is possible 😄 ). It has a solid ecosystem around it (helpers and libraries, etc) and enables to use both assert, should and expect type of syntax. |
I was following the model of VS Code itself, which includes the typings folder, and Go extension, which also includes the typings folder. At the very least, the typings folder is needed to provide links to VS Code's typings which are deeper within node_modules. Note that VS Code's extension scaffolding support also creates a typings folder: https://code.visualstudio.com/docs/extensions/example-hello-world. |
Good idea -- will do! |
Yup, I was planning to use chai as well. |
Is it possible to have |
It's certainly possible. We just need a gulp task that does the compilation. I actually went down that path for awhile, but it requires further refactoring. The problem is that our gulpfile.js depends on compilation already having loaded because it expects coreclr-debug and omnisharp modules to already be present. |
Since the repo started, we've had a single NPM script that ran on postinstall. All this did was run the VS Code install script and then launch tsc. Now, postinstall just runs the VS Code install script. The idea here is that install should really just lay down dependencies, not compile code. Compilation is split off into a separate script. Here are the new npm scripts: * `postinstall`: As described above, this now just runs the VS Code install script after `npm install`. * `compile`: Runs the VS Code compile script to transpile TypeScript to JavaScript. Run this with `npm run compile`. * `watch`: Runs the VS Code compile script with the '-watch' flag to transpile TypeScript to JavaScript, and then watch for file changes and incrementally compile. Run this with `npm run watch`. * `test`: Runs the tests with Mocha. Note: This will only run tests that are already transpiled to JavaScript. Run with `npm test`. * Unit tests can be written in the 'test' folder. See 'test/sanity.tests.ts' for an example. * The launch.json has been updated to allow debugging of unit tests with the "Launch Tests" configuration. * The "test" task is now configured so that you can use the "Tasks: Run Test Task" command in VS Code. * Whitespace is a bit out of control. I've made an executable decision that the repo should have spaces with an indent size of 4. This is now added to the settings.json. * The 'out' folder is now excluded in settings.json so you won't see it show up in your directory tree. * The 'node_modules' folder is now excluded from search. This has been bothering me for awhile.
489962b
to
94ca7e7
Compare
How are folks feeling about this? Shall I merge? |
@DustinCampbell LGTM |
NPM script clean up
Since the repo started, we've had a single NPM script that ran on postinstall. All this did was run the VS Code install script and then launch tsc. Now, postinstall just runs the VS Code install script. The idea here is that install should really just lay down dependencies, not compile code. Compilation is split off into a separate script.
Here are the new npm scripts:
postinstall
: As described above, this now just runs the VS Code install script afternpm install
.compile
: Runs the VS Code compile script to transpile TypeScript to JavaScript. Run this withnpm run compile
.watch
: Runs the VS Code compile script with the '-watch' flag to transpile TypeScript to JavaScript, and then watch for file changes and incrementally compile. Run this withnpm run watch
.test
: Runs the tests with Mocha. Note: This will only run tests that are already transpiled to JavaScript. Run withnpm test
.Unit tests
Fixing some settings