-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from snohio/lastlink/tests2
add yaml jest type validations
- Loading branch information
Showing
17 changed files
with
223 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import fs from "fs"; | ||
import yaml from "js-yaml"; | ||
|
||
import {createCheckers} from "ts-interface-checker"; | ||
import BoardYamlInterfaceTI from "../types/Board.yaml-interface-ti"; | ||
|
||
|
||
describe('board.yaml', () => { | ||
it('verify object', async () => { | ||
const { BoardYaml } = createCheckers(BoardYamlInterfaceTI); | ||
|
||
const filePath = path.join(__dirname, '../../src/_data/board.yaml'); | ||
const fileContents = fs.readFileSync(filePath, 'utf8'); | ||
const data = yaml.load(fileContents); | ||
|
||
const result = BoardYaml.strictValidate(data); | ||
|
||
expect(result).toBeNull(); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import fs from "fs"; | ||
import yaml from "js-yaml"; | ||
|
||
import {createCheckers} from "ts-interface-checker"; | ||
import GroupEventInterfaceTI from "../types/GroupEvent-interface-ti"; | ||
|
||
|
||
describe('events.yml', () => { | ||
it('verify object', () => { | ||
const { EventYaml } = createCheckers(GroupEventInterfaceTI); | ||
|
||
const filePath = path.join(__dirname, '../../src/_data/events.yaml'); | ||
const fileContents = fs.readFileSync(filePath, 'utf8'); | ||
const data = yaml.load(fileContents); | ||
|
||
const result = EventYaml.strictValidate(data); | ||
|
||
expect(result).toBeNull(); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import fs from "fs"; | ||
import yaml from "js-yaml"; | ||
|
||
import {createCheckers} from "ts-interface-checker"; | ||
import GroupsYamlInterfaceTI from "../types/Groups.yaml-interface-ti"; | ||
|
||
|
||
describe('groups.yaml', () => { | ||
it('verify object', async () => { | ||
const { GroupsYaml } = createCheckers(GroupsYamlInterfaceTI); | ||
|
||
const filePath = path.join(__dirname, '../../src/_data/groups.yaml'); | ||
const fileContents = fs.readFileSync(filePath, 'utf8'); | ||
const data = yaml.load(fileContents); | ||
|
||
const result = GroupsYaml.strictValidate(data); | ||
|
||
expect(result).toBeNull(); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import fs from "fs"; | ||
import yaml from "js-yaml"; | ||
|
||
import {createCheckers} from "ts-interface-checker"; | ||
import NavigationYamlInterfaceTI from "../types/Navigation.yaml-interface-ti"; | ||
|
||
|
||
describe('navigation.yaml', () => { | ||
it('verify object', async () => { | ||
const { NavigationYaml } = createCheckers(NavigationYamlInterfaceTI); | ||
|
||
const filePath = path.join(__dirname, '../../src/_data/navigation.yaml'); | ||
const fileContents = fs.readFileSync(filePath, 'utf8'); | ||
const data = yaml.load(fileContents); | ||
|
||
const result = NavigationYaml.strictValidate(data); | ||
|
||
expect(result).toBeNull(); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import fs from "fs"; | ||
import yaml from "js-yaml"; | ||
|
||
import {createCheckers} from "ts-interface-checker"; | ||
import QuicklinksYamlInterfaceTI from "../types/Quicklinks.yaml-interface-ti"; | ||
|
||
|
||
describe('quicklinks.yaml', () => { | ||
it('verify object', async () => { | ||
const { QuicklinksYaml } = createCheckers(QuicklinksYamlInterfaceTI); | ||
|
||
const filePath = path.join(__dirname, '../../src/_data/quicklinks.yaml'); | ||
const fileContents = fs.readFileSync(filePath, 'utf8'); | ||
const data = yaml.load(fileContents); | ||
|
||
const result = QuicklinksYaml.strictValidate(data); | ||
|
||
expect(result).toBeNull(); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import fs from "fs"; | ||
import yaml from "js-yaml"; | ||
|
||
import {createCheckers} from "ts-interface-checker"; | ||
import SettingsYamlInterfaceTI from "../types/Settings.yaml-interface-ti"; | ||
|
||
|
||
describe('settings.yaml', () => { | ||
it('verify object', async () => { | ||
const { SettingsYaml } = createCheckers(SettingsYamlInterfaceTI); | ||
|
||
const filePath = path.join(__dirname, '../../src/_data/settings.yaml'); | ||
const fileContents = fs.readFileSync(filePath, 'utf8'); | ||
const data = yaml.load(fileContents); | ||
|
||
const result = SettingsYaml.strictValidate(data); | ||
|
||
expect(result).toBeNull(); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import path from "path"; | ||
import fs from "fs"; | ||
import yaml from "js-yaml"; | ||
|
||
import {createCheckers} from "ts-interface-checker"; | ||
import SponsorsYamlInterfaceTI from "../types/Sponsors.yaml-interface-ti"; | ||
|
||
|
||
describe('sponsors.yaml', () => { | ||
it('verify object', async () => { | ||
const { SponsorsYaml } = createCheckers(SponsorsYamlInterfaceTI); | ||
|
||
const filePath = path.join(__dirname, '../../src/_data/sponsors.yaml'); | ||
const fileContents = fs.readFileSync(filePath, 'utf8'); | ||
const data = yaml.load(fileContents); | ||
|
||
const result = SponsorsYaml.strictValidate(data); | ||
|
||
expect(result).toBeNull(); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export interface BoardYaml { | ||
directors: Director[]; | ||
advisors: Advisor[]; | ||
former: Former[]; | ||
} | ||
|
||
export interface Advisor { | ||
name: string; | ||
position: string; | ||
} | ||
|
||
export interface Director { | ||
name: string; | ||
role: string; | ||
position: string; | ||
} | ||
|
||
export interface Former { | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface GroupsYaml { | ||
group: Group[]; | ||
} | ||
|
||
export interface Group { | ||
name: string; | ||
description?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface NavigationYaml { | ||
items: Item[]; | ||
} | ||
|
||
export interface Item { | ||
text: string; | ||
url?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export interface QuicklinksYaml { | ||
links: Link[]; | ||
} | ||
|
||
export interface Link { | ||
title: string; | ||
url: string; | ||
logo: string; | ||
logo2?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface SettingsYaml { | ||
name: string; | ||
author: string; | ||
url: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export interface SponsorsYaml { | ||
sponsors: Sponsor[]; | ||
} | ||
|
||
export interface Sponsor { | ||
name: string; | ||
link: string; | ||
img: string; | ||
} |