@@ -21,19 +21,23 @@ var path = require('path');
2121process . env . GCLOUD_PROJECT = 0 ;
2222
2323var assert = require ( 'assert' ) ;
24- var agent = require ( '..' ) ( ) ;
2524var api ;
25+ var Debuglet = require ( '../src/agent/debuglet.js' ) ;
26+ var debuglet ;
2627var h = require ( './fixtures/a/hello.js' ) ;
2728
2829describe ( 'repository relative paths' , function ( ) {
2930
3031 before ( function ( done ) {
31- agent . startAgent ( {
32+ var debug = require ( '..' ) ( { projectId : 'fake-project' } ) ;
33+ var config = {
3234 appPathRelativeToRepository : path . join ( path . sep , 'my' , 'project' , 'root' )
33- } ) ;
35+ } ;
36+ debuglet = new Debuglet ( debug , config ) ;
37+ debuglet . start ( ) ;
3438 setTimeout ( function ( ) {
3539 // Wait for v8debug api to initialize.
36- api = agent . private_ . v8debug_ ;
40+ api = debuglet . v8debug_ ;
3741 assert ( api , 'v8 debug api was not initialized in time' ) ;
3842 done ( ) ;
3943 } , 1500 ) ;
@@ -44,15 +48,16 @@ describe('repository relative paths', function() {
4448 'there should be no breakpoints active' ) ;
4549 assert . equal ( api . numListeners_ ( ) , 0 ,
4650 'there should be no listeners active' ) ;
51+ debuglet . stop ( ) ;
4752 } ) ;
4853
4954 it ( 'should correctly substitute when provided' , function ( done ) {
5055 var bp = {
5156 id : 0 ,
5257 location : {
5358 line : 3 ,
54- path : path . join ( path . sep , 'my' , 'project' , 'root' , 'test ' ,
55- 'fixtures' , 'a' , 'hello.js' )
59+ path : path . join ( path . sep , 'my' , 'project' , 'root' , 'packages' , 'debug ',
60+ 'test' , ' fixtures', 'a' , 'hello.js' )
5661 }
5762 } ;
5863 api . set ( bp , function ( err ) {
0 commit comments