Skip to content

Commit

Permalink
fix failed tests in CI?
Browse files Browse the repository at this point in the history
  • Loading branch information
loreanvictor committed Jan 5, 2024
1 parent 8e59e9b commit 5b421a8
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 18 deletions.
5 changes: 0 additions & 5 deletions e2e/all.test.mjs

This file was deleted.

File renamed without changes.
File renamed without changes.
11 changes: 7 additions & 4 deletions e2e/local-test.mjs → e2e/local.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ scenario('local', async (run, { ls, read }) => {
await run('local:../template')
expect(await ls()).toIncludeSameMembers([ '.tmplr.yml', 'halo.txt' ])
expect(await read('halo.txt')).toBe('Halo World!')
}, { root: 'target' })
}, {
root: 'target',
skipCI: true,
})


scenario('local-use', async (run, { ls, read }) => {
await run('use', 'local:../recipe')
expect(await ls()).toIncludeSameMembers([ 'halo.txt' ])
await run('use', 'local:./recipe')
expect(await ls()).toIncludeSameMembers([ 'halo.txt', 'recipe' ])
expect(await read('halo.txt')).toBe('Halo World!')
}, { root: 'target' })
})
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion e2e/util.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { createRequire } from 'module';
const require = createRequire(import.meta.url);

import { toIncludeSameMembers } from 'jest-extended'
expect.extend({ toIncludeSameMembers })

Expand All @@ -11,8 +14,10 @@ export function scenario(name, testFn, options) {
options ??= {}
options.root ??= '.'

const fn = options.skipCI && require('ci-info').isCI ? test.skip : test

describe('scenario: ' + name, () => {
test('runs as expected', async () => {
fn('runs as expected', async () => {
const fixsrc = name.split(':')[0]
const fixture = join('e2e', 'fixtures', fixsrc)

Expand Down
40 changes: 32 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"babel-jest": "^28.1.0",
"ci-info": "^4.0.0",
"cross-env": "^7.0.3",
"eslint": "^8.15.0",
"eslint-plugin-jest-extended": "^2.0.0",
Expand Down

0 comments on commit 5b421a8

Please sign in to comment.