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

No source map support? #40

Open
binarykitchen opened this issue Jun 18, 2016 · 1 comment
Open

No source map support? #40

binarykitchen opened this issue Jun 18, 2016 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@binarykitchen
Copy link

With the browserify command, all gets bundled and in case of an error, it does not point to the correct line number of the source code. Is there a trick to make this happen?

@syarul
Copy link

syarul commented Sep 15, 2017

Taken back what I've written before;

simple solution is to use source-map-support

you write your test i.e

require('source-map-support').install()

var test = require('tape-catch')

test('virtual dom', function(t) {

  t.plan(1)
  t.equal(1, 2)
  t.end()

})

compile it with browserify in debug mode

browserify test.js --debug | tape-run

process.stdout output will have the source mapping to your files.

TAP version 13                                                                                                                      
# virtual dom                                                                                                                       
not ok 1 should be equal                                                                                                            
  ---                                                                                                                               
    operator: equal                                                                                                                 
    expected: 2                                                                                                                     
    actual:   1                                                                                                                     
    at: Test.assert [as _assert] (/node_modules/tape/lib/test.js:216:1)                                                             
    stack: |-                                                                                                                       
      Error: should be equal                                                                                                        
          at Test.assert [as _assert] (/node_modules/tape/lib/test.js:212:1)                                                        
          at Test.bound [as _assert] (/node_modules/tape/lib/test.js:64:1)                                                          
          at Test.equal.Test.equals.Test.isEqual.Test.is.Test.strictEqual.Test.strictEquals (/node_modules/tape/lib/test.js:347:1)  
          at Test.bound (/node_modules/tape/lib/test.js:64:1)                                                                       
          at Test.<anonymous> (/http:/vdom.js:9:1)                                                                                  
          at Test.bound [as _cb] (/node_modules/tape/lib/test.js:64:1)                                                              
          at Test.exports.Test.run (/node_modules/tape-catch/index.js:26:1)                                                         
          at Test.bound [as run] (/node_modules/tape/lib/test.js:64:1)                                                              
          at next (/node_modules/tape/lib/results.js:71:1)                                                                          
          at Item.run (/http:/C:/Users/SHAHRUL/AppData/Roaming/npm/node_modules/browserify/node_modules/process/browser.js:64:1)    
  ...                                                                                                                               
                                                                                                                                    
1..1                                                                                                                                
# tests 1                                                                                                                           
# pass  0                                                                                                                           
# fail  1                                                                                                                           

@fregante fregante added the documentation Improvements or additions to documentation label Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants