ghaschel / stylus-true

Framework to unit test your Stylus files.
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

"use" calls cannot find the correct paths #34

Open rossclarkartist opened 2 years ago

rossclarkartist commented 2 years ago

When implementing testing through the stylus interface "use" calls cannot find the correct paths. For example:

My Code

@require '../node_modules/stylus-true/styl/_true.styl';
@import '../_styl/function/stylus-func-size/index.styl';  
@import '../_styl/function/stylus-func-prop/index.styl';

+test-module('CreateUnit [function]') {
    // Test 1
     +test('Returns two lists zipped together') {
        assert-equal(
            CreateUnit(10, px),
            (10px)
        );
    }
}

Actual Output

No output file is produced

home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/bin/stylus:684
              throw err;
              ^

Error: node_modules/stylus-true/styl/true/_utilities.styl:1:1
   1| use('lib/str-length.js');
------^
   2| 
   3| // map-keys($hash)
   4| // 

failed to locate plugin file "lib/str-length.js"

    at Evaluator.use (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/functions/use.js:26:21)
    at Evaluator.invokeBuiltin (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/visitor/evaluator.js:1054:30)
    at Evaluator.visitCall (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/visitor/evaluator.js:516:16)
    at Visitor.visit (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/visitor/index.js:28:40)
    at Evaluator.visit (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/visitor/evaluator.js:160:18)
    at Evaluator.visitExpression (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/visitor/evaluator.js:644:26)
    at Visitor.visit (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/visitor/index.js:28:40)
    at Evaluator.visit (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/visitor/evaluator.js:160:18)
    at Evaluator.visitBlock (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/visitor/evaluator.js:720:39)
    at Visitor.visit (/home/ross/Development/VCS/FabbyCat/bastet-stylus--x/node_modules/stylus/lib/visitor/index.js:28:40) {
  lineno: 1,
  column: 1,
  filename: 'node_modules/stylus-true/styl/true/_utilities.styl',
  stylusStack: '',
  input: "use('lib/str-length.js');\r\n" +

Expected Output

After updating .styl files. This is the output generated when all paths are altered to use ../../lib/ instead of lib/


/* # Module: CreateUnit [function] */
/* ------------------------------- */
/* Test: 'Returns two lists zipped together' */
/*   ✔ [assert-equal] */
/*  */
/*  */
ghaschel commented 1 year ago

I'll take a look on this. Sorry for the late reply. I didn't see this

rossclarkartist commented 1 year ago

No problems. I'm away until Jan 2nd. If you need further info let me know.