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

Testing Plugins does not currently work #485

Closed
markgrovs opened this issue Apr 15, 2013 · 3 comments
Closed

Testing Plugins does not currently work #485

markgrovs opened this issue Apr 15, 2013 · 3 comments

Comments

@markgrovs
Copy link

I am working on my own plugin and was having trouble getting the tests to run. So I tried to run a few of the existing plugin tests and they all fail with a similar error.

It seems that the test framework is looking for docpad-plugin-less.tester.js within the out folder, but the pattern should be less.tester.js.

Marks-Mac-Pro:docpad-plugin-less mgroves$ cake test

docpad-plugin-less@2.1.3 test /Users/mgroves/Development/docpad-plugin-less
node ./out/less.test.js

FAILURE: 0/0 tests ran successfully; 0 failed, 0 incomplete, 1 errors

Error #1:
uncaughtException
Error: Cannot find module '/Users/mgroves/Development/docpad-plugin-less/out/docpad-plugin-less.tester.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.testers.test.test (/Users/mgroves/Development/docpad/out/lib/testers.js:257:17)
at Object. (/Users/mgroves/Development/docpad-plugin-less/out/less.test.js:2:38)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0

/Users/mgroves/Development/docpad-plugin-less/Cakefile:126
throw err;
^
1

balupton added a commit that referenced this issue Apr 16, 2013
- v6.30.4 April 16, 2013
	- Testing of plugins now works when the plugin directory is the full
plugin name
		- Thanks to [Mark Groves](https://github.com/mgroves84) for [issue
#485](#485)
@balupton
Copy link
Member

Sweet thanks for reporting. Just fixed this in v6.30.4. The reason I never experienced this is that we've been cloning out the plugins for development like so:

git clone https://github.com/docpad/docpad-plugin-less.git less

So the directory name is the short name used for the file naming. Fixed this up so the detected plugin name is the directory name with docpad-plugin- removed. Let me know how it goes.

Dev note: We may actually want to extend this new way of detecting the plugin name to the plugin loader, so we don't have to define the name: 'blah' inside the plugin class.

@markgrovs
Copy link
Author

Thanks! Plugin tests now work. Now I just need to finish my plugin 👍

@balupton
Copy link
Member

I've also just updated the plugin write guide, noticed that it was a bit out of date (sorry about that!)

balupton added a commit that referenced this issue Oct 23, 2013
- v6.30.4 April 16, 2013
	- Testing of plugins now works when the plugin directory is the full
plugin name
		- Thanks to [Mark Groves](https://github.com/mgroves84) for [issue
#485](#485)
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

No branches or pull requests

2 participants