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

Add support for Tape test framework #989

Merged
merged 8 commits into from
Jun 13, 2016

Conversation

jcansdale
Copy link
Contributor

Issue #986

Fix

This pull adds support for the Tape JavaScript test framework.

There are unit tests for this in a separate project:
https://github.com/jcansdale/TestFrameworksNTVS

It would be nice to integrate these at some point (they are in a .njsproj project). I don't know where it would make sense to put them? The test framework support is useful on its own though, so I've submitted this pull request without the tests.

@msftclas
Copy link

msftclas commented Jun 8, 2016

Hi @jcansdale, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.

TTYL, MSBOT;

@jcansdale
Copy link
Contributor Author

Oops, I forgot to add the tape.js test framework to the installer. I'll update my branch and report back.

…ugh to include contents of directory (i.e. 'tape.js')?
@jcansdale
Copy link
Contributor Author

Added 'TestFrameworks\Tape' folder to Wix installer file. Is this enough to include the contained 'tape.js' file? Please check this because I haven't been able to build the installer locally!

@jcansdale jcansdale closed this Jun 8, 2016
@jcansdale jcansdale reopened this Jun 8, 2016
@msftclas
Copy link

msftclas commented Jun 8, 2016

Hi @jcansdale, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.

TTYL, MSBOT;

@@ -0,0 +1,75 @@
var fs = require('fs');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] I'm not sure our other test frameworks do this, but please add "use strict"; for this new file.

@mjbvz
Copy link
Contributor

mjbvz commented Jun 8, 2016

Thanks for looking into this! Just two minor comments and then we can merge the change in. We'll try to get this into the next NTVS 1.2 release if possible.

When loading test script throws, output error and continue loading other scripts.
Use strict.
@jcansdale
Copy link
Contributor Author

Thanks for the code review! I've incorporated your suggestions.

@@ -15,6 +15,7 @@
<Directory Id="Dir_$(var.key)TestFrameworks" Name="TestFrameworks">
<Directory Id="Dir_$(var.key)TestFrameworksExportRunner" Name="ExportRunner" />
<Directory Id="Dir_$(var.key)TestFrameworksMocha" Name="Mocha" />
<Directory Id="Dir_$(var.key)TestFrameworksTape" Name="Tape" />
Copy link
Contributor

@mousetraps mousetraps Jun 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The directory is defined, but it's not being used anywhere. You'll also need to include a File Include in NodejsToolsFiles.proj, otherwise it won't get installed via the msi.

       <File Include="TestFrameworks\tape\tape.js">
            <InstallDirectory>TestFrameworksTape</InstallDirectory>
        </File>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also you mentioned you were unable to build the installer? What error were you running into?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been able to get the installer built. I'm a PowerShell newb, but you have good documentation!

@mousetraps
Copy link
Contributor

mousetraps commented Jun 9, 2016

Hey @jcansdale , thanks for the contribution! We've had a lot of folks request tape support lately, so it's exciting to finally add support! Sorry for jumping into this a little late... left a few more comments. We're cutting it a bit close for the v1.2 Beta ship-train, but let's definitely aim to pull this into a subsequent v1.2 release.

@jcansdale
Copy link
Contributor Author

What happened to all of @mousetraps comments? I can't find them anywhere! 😕

@mjbvz
Copy link
Contributor

mjbvz commented Jun 9, 2016

Sorry, @mousetraps got flagged as a bot by github for some reason, which hides all of her comments and prs. We've contacted Github support to get this fixed as soon as possible. Everything should show up again after that.

@mousetraps
Copy link
Contributor

Had to send in some DNA, and the good news is that I've been declared human! All my comments should now be visible 😃

@jcansdale
Copy link
Contributor Author

Congratulations on your machine like speed and efficiency, but I'm glad to hear you've been confirmed as human! 😉

Added InstallDirectory entry for 'tape.js'.
Follow always use curly brackets convention.
@jcansdale
Copy link
Contributor Author

@mousetraps I've implemented your various suggestions, including:

Added Tape UnitTest file templates for JavaScript and TypeScript.
Made error messages more helpful.

If you have a chance to give it a try, I'd be interested to hear how you get on.

<ZipItem Include="Templates\Files\TapeUnitTest\UnitTest.js" />
<ZipItem Include="Templates\Files\TapeUnitTest\UnitTest.vstemplate" />
<ZipItem Include="Templates\Files\TypeScriptTapeUnitTest\UnitTest.vstemplate" />
<ZipItem Include="Templates\Files\TypeScriptTapeUnitTest\UnitTest.ts" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor note which can be addressed later... we'll need to update the VS "15" template manifest to account for this change.
https://github.com/Microsoft/nodejstools/blob/master/Nodejs/Product/Nodejs/Templates/VS_Nodejs.item.vstman

EDIT: filed an issue here: #1027

@mousetraps
Copy link
Contributor

👍

Nice work, thanks!! We'll merge this in and start testing... hopefully it'll make 1.2 Beta! 😃

@mousetraps mousetraps merged commit f7d0a0a into microsoft:master Jun 13, 2016
@jcansdale jcansdale deleted the tape-test-framework branch June 13, 2016 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants