1 | "use strict";
|
2 |
|
3 | var _ajv = _interopRequireDefault(require("ajv"));
|
4 |
|
5 | var _schema = _interopRequireDefault(require("./schema"));
|
6 |
|
7 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8 |
|
9 | const ajv = new _ajv.default();
|
10 | const successValidates = {
|
11 | entry: ['a', ['a']],
|
12 | file: ['a'],
|
13 | esm: [false, true, {
|
14 | type: 'rollup'
|
15 | }, {
|
16 | type: 'babel'
|
17 | }, {
|
18 | file: 'a'
|
19 | }, {
|
20 | mjs: true
|
21 | }],
|
22 | cjs: [false, true, {
|
23 | type: 'rollup'
|
24 | }, {
|
25 | type: 'babel'
|
26 | }, {
|
27 | file: 'a'
|
28 | }],
|
29 | umd: [{
|
30 | globals: {}
|
31 | }, {
|
32 | file: 'a'
|
33 | }, {
|
34 | name: 'a'
|
35 | }, {
|
36 | minFile: false
|
37 | }, {
|
38 | minFile: true
|
39 | }],
|
40 | extraBabelPlugins: [[]],
|
41 | extraBabelPresets: [[]],
|
42 | extraPostCSSPlugins: [[]],
|
43 | cssModules: [true, false, {}],
|
44 | autoprefixer: [{}],
|
45 | namedExports: [{}],
|
46 | runtimeHelpers: [true, false],
|
47 | target: ['node', 'browser'],
|
48 | overridesByEntry: [{}],
|
49 | doc: [{}]
|
50 | };
|
51 | Object.keys(successValidates).forEach(key => {
|
52 | test(key, () => {
|
53 | successValidates[key].forEach(item => {
|
54 | expect(ajv.validate(_schema.default, {
|
55 | [key]: item
|
56 | })).toEqual(true);
|
57 | });
|
58 | });
|
59 | }); |
\ | No newline at end of file |