You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
762 B

  1. 'use strict';
  2. var path = require('path');
  3. var layoutsManager = require('../tasks/lib/layouts_manager');
  4. exports.layouts_manager = {
  5. defaultLayouts: function(test) {
  6. test.expect(2);
  7. var byTypeLayout = layoutsManager.getLayout('byType');
  8. test.equal(byTypeLayout('js', 'bootstrap'), path.normalize('js/bootstrap'));
  9. var byComponentLayout = layoutsManager.getLayout('byComponent');
  10. test.equal(byComponentLayout('sass', 'bourbone'), path.normalize('bourbone/sass'));
  11. test.done();
  12. },
  13. customLayout: function(test) {
  14. test.expect(1);
  15. var customLayout = layoutsManager.getLayout(function(type, pkg) {
  16. return type + pkg;
  17. });
  18. test.equal(customLayout('img', 'logo.png'), 'imglogo.png');
  19. test.done();
  20. }
  21. };