Skip to content

Commit f1bbecd

Browse files
committed
Filter out drafts from tests
1 parent 8dbfc31 commit f1bbecd

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

posts/__tests__/posts.test.ts

+12-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,18 @@ const postModules = {
2323

2424
describe('validate posts', () => {
2525
test.each(
26-
Object.keys(postModules).map((importPath) => [
27-
path.relative('/posts', importPath),
28-
importPath,
29-
]),
26+
Object.keys(postModules)
27+
.filter((importPath) => {
28+
const meta = postModules[importPath]
29+
if ('seriesPart' in meta) {
30+
return (
31+
'published' in
32+
postModules[path.join(path.dirname(importPath), 'series.json')]
33+
)
34+
}
35+
return 'published' in meta
36+
})
37+
.map((importPath) => [path.relative('/posts', importPath), importPath]),
3038
)('%s', async (basename, importPath) => {
3139
const meta = postModules[importPath]
3240
expect(meta).toHaveProperty('title')

0 commit comments

Comments
 (0)