|
| 1 | +/** |
| 2 | + * @file Unit Tests - EXT_JSON_REGEX |
| 3 | + * @module ext-regex/regex/tests/unit/json |
| 4 | + */ |
| 5 | + |
| 6 | +import TEST_SUBJECT from '../json' |
| 7 | + |
| 8 | +describe('unit:EXT_JSON_REGEX', () => { |
| 9 | + describe('.json', () => { |
| 10 | + it('should match extension ".json"', () => { |
| 11 | + expect(TEST_SUBJECT.exec('.json')).toMatchSnapshot() |
| 12 | + }) |
| 13 | + |
| 14 | + it('should match module id given last extension is ".json"', () => { |
| 15 | + expect(TEST_SUBJECT.exec('build.config.json')).toMatchSnapshot() |
| 16 | + }) |
| 17 | + |
| 18 | + it('should match module id given only extension is ".json"', () => { |
| 19 | + expect(TEST_SUBJECT.exec('package.json')).toMatchSnapshot() |
| 20 | + }) |
| 21 | + }) |
| 22 | + |
| 23 | + describe('.json5', () => { |
| 24 | + it('should match extension ".json5"', () => { |
| 25 | + expect(TEST_SUBJECT.exec('.json5')).toMatchSnapshot() |
| 26 | + }) |
| 27 | + |
| 28 | + it('should match module id given last extension is ".json5"', () => { |
| 29 | + expect(TEST_SUBJECT.exec('build.config.json5')).toMatchSnapshot() |
| 30 | + }) |
| 31 | + |
| 32 | + it('should match module id given only extension is ".json5"', () => { |
| 33 | + expect(TEST_SUBJECT.exec('.markdownlint.json5')).toMatchSnapshot() |
| 34 | + }) |
| 35 | + }) |
| 36 | + |
| 37 | + describe('.jsonc', () => { |
| 38 | + it('should match extension ".jsonc"', () => { |
| 39 | + expect(TEST_SUBJECT.exec('.jsonc')).toMatchSnapshot() |
| 40 | + }) |
| 41 | + |
| 42 | + it('should match module id given last extension is ".jsonc"', () => { |
| 43 | + expect(TEST_SUBJECT.exec('build.config.jsonc')).toMatchSnapshot() |
| 44 | + }) |
| 45 | + |
| 46 | + it('should match module id given only extension is ".jsonc"', () => { |
| 47 | + expect(TEST_SUBJECT.exec('.markdownlint.jsonc')).toMatchSnapshot() |
| 48 | + }) |
| 49 | + }) |
| 50 | +}) |
0 commit comments