Skip to content

Commit

Permalink
chore(style): use single quotes for strings
Browse files Browse the repository at this point in the history
  • Loading branch information
brandondoran committed Oct 31, 2018
1 parent 3cb7e7a commit 9d8d8ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -76,6 +76,9 @@
"peerDependencies": {
"webpack": ">=1.0.0"
},
"prettier": {
"singleQuote": true
},
"release": {
"verifyConditions": [
"@semantic-release/changelog",
Expand Down
15 changes: 11 additions & 4 deletions src/reporters/__tests__/datadog.test.ts
Expand Up @@ -10,30 +10,37 @@ describe('DataDogStatsReporter', () => {
beforeEach(() => {
options = {
apiKey: 'test-key',
gzipSize: true,
metricName: 'testapp.assets'
};
reporter = new DataDogStatsReporter(options);
});

describe('constructor', () => {
it('should be an instance of DataDogStatsReporter', () => {
expect(reporter).toBeInstanceOf(DataDogStatsReporter)
expect(reporter).toBeInstanceOf(DataDogStatsReporter);
});

it('should throw if options.apiKey is missing', () => {
delete options.apiKey;
expect(() => new DataDogStatsReporter(options)).toThrowErrorMatchingSnapshot();
expect(
() => new DataDogStatsReporter(options)
).toThrowErrorMatchingSnapshot();
});

it('should throw if options.metricName is missing', () => {
delete options.metricName;
expect(() => new DataDogStatsReporter(options)).toThrowErrorMatchingSnapshot();
expect(
() => new DataDogStatsReporter(options)
).toThrowErrorMatchingSnapshot();
});

it('should throw if multiple options are missing', () => {
delete options.apiKey;
delete options.metricName;
expect(() => new DataDogStatsReporter(options)).toThrowErrorMatchingSnapshot();
expect(
() => new DataDogStatsReporter(options)
).toThrowErrorMatchingSnapshot();
});
});
});
3 changes: 2 additions & 1 deletion tsconfig.json
Expand Up @@ -20,7 +20,8 @@
"src/**/*"
],
"exclude": [
"lib",
"node_modules",
"**/*-spec.ts"
"__tests__"
]
}

0 comments on commit 9d8d8ee

Please sign in to comment.