DefinitelyTyped/types/karma-snapshot/karma-snapshot-tests.ts
Piotr Błażejewicz (Peter Blazejewicz) 7aba76e825
feat(karma-snapshot): new type definition (#43131)
As used in the open-wc project

- type definitions
- tests

https://github.com/localvoid/karma-snapshot

Thanks!
2020-03-31 15:41:36 -07:00

28 lines
821 B
TypeScript

// karma.conf.js
import karma = require('karma');
import path = require('path');
const resolver: karma.SnapshotPathResolver = (basePath, suiteName) => {
return path.join(basePath, '__snapshots__', suiteName + '.md');
};
module.exports = (config: karma.Config) => {
config.set({
browsers: ['ChromeHeadless'],
frameworks: ['mocha', 'snapshot', 'mocha-snapshot'],
reporters: ['mocha'],
preprocessors: {
'**/__snapshots__/**/*.md': ['snapshot'],
},
files: ['**/__snapshots__/**/*.md', '__tests__/index.js'],
snapshot: {
update: true,
prune: false,
format: 'indented-md',
checkSourceFile: true,
pathResolver: resolver,
limitUnusedSnapshotsInWarning: -1,
},
});
};