DefinitelyTyped/types/webpack-bugsnag-plugins/webpack-bugsnag-plugins-tests.ts
Spencer Miskoviak 787bafe3f2 Add webpack-bugsnag-plugins types (#35931)
* Generate the types/webpack-bugsnag-plugins files

* Fill in the type definitions and tests

* Add a typescript version

* Decrease the TypeScript version to match webpack's
2019-06-04 14:59:22 -07:00

82 lines
1.7 KiB
TypeScript

import {
BugsnagSourceMapUploaderPlugin,
BugsnagBuildReporterPlugin
} from "webpack-bugsnag-plugins";
/**
* Missing or invalid options
*/
// $ExpectError
new BugsnagSourceMapUploaderPlugin();
// $ExpectError
new BugsnagBuildReporterPlugin();
// $ExpectError
new BugsnagSourceMapUploaderPlugin({});
// $ExpectError
new BugsnagBuildReporterPlugin({});
// $ExpectError
new BugsnagBuildReporterPlugin({
apiKey: "123456789"
});
/**
* Minimal valid options
*/
// $ExpectType BugsnagSourceMapUploaderPlugin
new BugsnagSourceMapUploaderPlugin({
apiKey: "123456789"
});
// $ExpectType BugsnagBuildReporterPlugin
new BugsnagBuildReporterPlugin({
apiKey: "123456789",
appVersion: "1.2.3"
});
/**
* All possible options
*/
// $ExpectType BugsnagSourceMapUploaderPlugin
new BugsnagSourceMapUploaderPlugin({
apiKey: "123456789",
publicPath: "*/dist",
appVersion: "1.2.3",
overwrite: true,
endpoint: "https://upload.bugsnag.com",
ignoredBundleExtensions: [".css"]
});
// $ExpectType BugsnagBuildReporterPlugin
new BugsnagBuildReporterPlugin(
{
apiKey: "123456789",
appVersion: "1.2.3",
releaseStage: "staging",
sourceControl: {
provider: "github",
repository: "https://github.com/bugsnag/webpack-bugsnag-plugins",
revision: "123456789"
},
builderName: "whoami",
autoAssignRelease: false
},
{
logLevel: "debug",
logger: {
debug: () => null,
info: () => null,
warn: () => null,
error: () => null
},
path: process.cwd(),
endpoint: "https://build.bugsnag.com"
}
);