This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 255981 - Grunt testfile ide action configuration - how to specify filename?
Summary: Grunt testfile ide action configuration - how to specify filename?
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Tools (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-17 10:40 UTC by capricious
Modified: 2015-10-19 11:02 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Gruntfile.js (1.49 KB, application/javascript)
2015-10-19 11:02 UTC, capricious
Details

Note You need to log in before you can comment on or make changes to this bug.
Description capricious 2015-10-17 10:40:59 UTC
Hi,

in the project properties for the grunt builder (8.1RC(2)) you can "Assign IDE actions to Grunt tasks".
There is e.g. Test File.
I've setup a grunt task testfile:filename which needs the filename as parameter.

What is the placeholder or variable in Netbeans for the filename?

There is no user documentation available for this important information.
Does anyone know the variables?
Are there variables? I have not found any common syntax which would get replaced on execution.

Thanks
Markus
Comment 1 Tomas Mysik 2015-10-19 05:36:48 UTC
(In reply to capricious from comment #0)
> What is the placeholder or variable in Netbeans for the filename?

Just to be sure - can you please provide an example of such a Grunt task and what it does exactly?

> Are there variables?

No, none at the moment. Feel free to provide a list of possible variables, we could add them.

Thanks for reporting.
Comment 2 capricious 2015-10-19 11:02:02 UTC
Created attachment 156796 [details]
Gruntfile.js

With the attached Grunfile.js you can do something like...

sh> grunt testfile:test/app/models/ratelimit.js 
Running "testfile:test/app/models/ratelimit.js" (testfile) task
testfile: test/app/models/ratelimit.js

Running "jshint:files" (jshint) task
>> 2 files lint free.

Running "mochaTest:test" (mochaTest) task


synchronizing database n4vnewsletter_test
synchronized database n4vnewsletter_test
  Ratelimit
    #update
      ✓ should increase blockcount (116ms)


  1 passing (1s)


Done, without errors.


The 0before.js is the database setup needed for all of my tests.
The task replaces the default file list with the 0before.js plus the one specified after the colon.

So it would be nice to provide a variable with the currently active test file or the test file you would navigate to with Ctrl+Alt+T.