Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
fileName: '/Applications/Atom.app/pathwatcher.js',
functionName: 'foo',
location: '/Applications/Atom.app/pathwatcher.js:10:5'
},
{
fileName: '/Users/me/.atom/packages/metrics/lib/metrics.js',
functionName: 'bar',
location: '/Users/me/.atom/packages/metrics/lib/metrics.js:161:5'
}
]
let deprecation = {
message: 'bad things are bad',
stacks: [stack]
}
grim.addSerializedDeprecation(deprecation)
spyOn(atom.packages.getLoadedPackage('metrics').mainModule, 'getPackagePathsByPackageName').andReturn({
metrics: '/Users/me/.atom/packages/metrics'})
jasmine.restoreDeprecationsSnapshot()
await conditionPromise(() => Reporter.addCustomEvent.callCount > 0)
const args = Reporter.addCustomEvent.mostRecentCall.args
expect(args[0]).toEqual('deprecation-v3')
const event = args[1]
expect(event.ec).toEqual('deprecation-v3')
expect(event.el).toEqual('bad things are bad')
})
})