Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sentry/webpack-plugin

Package Overview
Dependencies
Maintainers
9
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/webpack-plugin - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

2

package.json

@@ -11,3 +11,3 @@ {

"author": "Sentry",
"version": "1.4.0",
"version": "1.5.0",
"license": "MIT",

@@ -14,0 +14,0 @@ "repository": "git@github.com:getsentry/sentry-webpack-plugin.git",

@@ -75,3 +75,7 @@ /*eslint-disable*/

compiler = {
plugin: jest.fn(),
hooks: {
afterEmit: {
tapAsync: jest.fn(),
},
},
};

@@ -92,10 +96,33 @@ });

test('should call `compiler.plugin()` with `after-emit` and callback function', () => {
test('should call `compiler.hooks.afterEmit.tapAsync()` with callback function', () => {
const sentryCliPlugin = new SentryCliPlugin();
sentryCliPlugin.apply(compiler);
expect(compiler.plugin).toHaveBeenCalled();
expect(compiler.plugin.mock.calls[0][0]).toBe('after-emit');
expect(typeof compiler.plugin.mock.calls[0][1]).toBe('function');
expect(compiler.hooks.afterEmit.tapAsync).toHaveBeenCalledWith('SentryCliPlugin', expect.any(Function));
});
describe('Webpack <= 3', () => {
let _compiler;
beforeAll(() => {
_compiler = compiler;
});
beforeEach(() => {
compiler = {
plugin: jest.fn(),
};
});
afterAll(() => {
compiler = _compiler;
});
test('should call `compiler.plugin()` with `after-emit` and callback function', () => {
const sentryCliPlugin = new SentryCliPlugin();
sentryCliPlugin.apply(compiler);
expect(compiler.plugin).toHaveBeenCalledWith('after-emit', expect.any(Function));
});
});
});

@@ -115,5 +142,9 @@

compiler = {
plugin: jest.fn((event, callback) =>
callback(compilation, compilationDoneCallback)
),
hooks: {
afterEmit: {
tapAsync: jest.fn((name, callback) =>
callback(compilation, compilationDoneCallback)
),
},
},
};

@@ -120,0 +151,0 @@ });

@@ -94,2 +94,10 @@ const SentryCli = require('@sentry/cli');

}
attachAfterEmitHook(compiler, callback) {
// Backwards compatible version of: compiler.plugin.afterEmit.tapAsync()
if (compiler.hooks) {
compiler.hooks.afterEmit.tapAsync('SentryCliPlugin', callback);
} else {
compiler.plugin('after-emit', callback);
}
}

@@ -107,3 +115,3 @@ apply(compiler) {

compiler.plugin('after-emit', (compilation, cb) => {
this.attachAfterEmitHook(compiler, (compilation, cb) => {
function handleError(message, errorCb) {

@@ -110,0 +118,0 @@ compilation.errors.push(`Sentry CLI Plugin: ${message}`);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc