Skip to content

Commit

Permalink
Move & reorganise test files under tests/
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Jan 23, 2019
1 parent e316773 commit 12876df
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
/docs/source/layouts/
/docs/source/stylesheets/
/package-lock.json
/__tests__/yaml-test-suite/
/tests/yaml-test-suite/
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[submodule "__tests__/yaml-test-suite"]
path = __tests__/yaml-test-suite
[submodule "tests/yaml-test-suite"]
path = tests/yaml-test-suite
url = https://github.com/eemeli/yaml-test-suite.git
branch = fixed-data
[submodule "docs"]
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
/docs/source/layouts/
/docs/source/stylesheets/
/package*.json
/__tests__/yaml-test-suite/
/tests/yaml-test-suite/
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"scripts": {
"build": "babel src/ --out-dir dist/",
"prettier": "prettier --write \"{src,__tests__}/**/*.js\"",
"prettier": "prettier --write \"{src,tests}/**/*.js\"",
"lint": "eslint src/",
"test": "TRACE_LEVEL=log jest",
"test:trace": "TRACE_LEVEL=trace,log jest --no-cache",
Expand Down Expand Up @@ -57,9 +57,12 @@
]
},
"jest": {
"testMatch": [
"**/tests/**/*.js"
],
"testPathIgnorePatterns": [
"__tests__/common",
"__tests__/cst/common"
"tests/common",
"tests/cst/common"
]
},
"prettier": {
Expand Down Expand Up @@ -117,8 +120,7 @@
},
{
"files": [
"__tests__/*.js",
"__tests__/cst/*.js"
"tests/**/*.js"
],
"env": {
"es6": true,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions __tests__/YAML-1.2.spec.js → tests/doc/YAML-1.2.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import YAML from '../src/index'
import { strOptions } from '../src/schema/_string'
import YAML from '../../src/index'
import { strOptions } from '../../src/schema/_string'

const spec = {
'2.1. Collections': {
Expand Down
6 changes: 3 additions & 3 deletions __tests__/anchors.js → tests/doc/anchors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import YAML from '../src/index'
import Map from '../src/schema/Map'
import Merge from '../src/schema/Merge'
import YAML from '../../src/index'
import Map from '../../src/schema/Map'
import Merge from '../../src/schema/Merge'

test('basic', () => {
const src = `- &a 1\n- *a\n`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import YAML from '../src/index'
import Pair from '../src/schema/Pair'
import YAML from '../../src/index'
import Pair from '../../src/schema/Pair'

describe('Map', () => {
let map
Expand Down
2 changes: 1 addition & 1 deletion __tests__/comments.js → tests/doc/comments.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import YAML from '../src/index'
import YAML from '../../src/index'

describe('parse comments', () => {
describe('body', () => {
Expand Down
6 changes: 3 additions & 3 deletions __tests__/corner-cases.js → tests/doc/corner-cases.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs'
import path from 'path'
import Node from '../src/cst/Node'
import YAML from '../src/index'
import Node from '../../src/cst/Node'
import YAML from '../../src/index'

test('eemeli/yaml#2', () => {
const src = `
Expand Down Expand Up @@ -74,7 +74,7 @@ aliases:

test('complete file', () => {
const src = fs.readFileSync(
path.resolve(__dirname, './artifacts/prettier-circleci-config.yml'),
path.resolve(__dirname, '../artifacts/prettier-circleci-config.yml'),
'utf8'
)
const doc = YAML.parseDocument(src)
Expand Down
12 changes: 6 additions & 6 deletions __tests__/createNode.js → tests/doc/createNode.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import YAML from '../src/index'
import YAMLMap from '../src/schema/Map'
import Pair from '../src/schema/Pair'
import Scalar from '../src/schema/Scalar'
import YAMLSeq from '../src/schema/Seq'
import { YAMLSet } from '../src/schema/_set'
import YAML from '../../src/index'
import YAMLMap from '../../src/schema/Map'
import Pair from '../../src/schema/Pair'
import Scalar from '../../src/schema/Scalar'
import YAMLSeq from '../../src/schema/Seq'
import { YAMLSet } from '../../src/schema/_set'

describe('scalars', () => {
describe('createNode(value, false)', () => {
Expand Down
6 changes: 3 additions & 3 deletions __tests__/foldFlowLines.js → tests/doc/foldFlowLines.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fold, { FOLD_FLOW, FOLD_QUOTED } from '../src/foldFlowLines'
import YAML from '../src/index'
import { strOptions } from '../src/schema/_string'
import fold, { FOLD_FLOW, FOLD_QUOTED } from '../../src/foldFlowLines'
import YAML from '../../src/index'
import { strOptions } from '../../src/schema/_string'

describe('plain', () => {
const src = 'abc def ghi jkl mno pqr stu vwx yz\n'
Expand Down
4 changes: 2 additions & 2 deletions __tests__/stringify.js → tests/doc/stringify.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import YAML from '../src/index'
import { strOptions } from '../src/schema/_string'
import YAML from '../../src/index'
import { strOptions } from '../../src/schema/_string'

test('undefined', () => {
expect(YAML.stringify()).toBe('\n')
Expand Down
12 changes: 6 additions & 6 deletions __tests__/types.js → tests/doc/types.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import YAML from '../src/index'
import Scalar from '../src/schema/Scalar'
import YAMLSeq from '../src/schema/Seq'
import { YAMLOMap } from '../src/schema/_omap'
import { YAMLSet } from '../src/schema/_set'
import { strOptions } from '../src/schema/_string'
import YAML from '../../src/index'
import Scalar from '../../src/schema/Scalar'
import YAMLSeq from '../../src/schema/Seq'
import { YAMLOMap } from '../../src/schema/_omap'
import { YAMLSet } from '../../src/schema/_set'
import { strOptions } from '../../src/schema/_string'

let origFoldOptions

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 12876df

Please sign in to comment.