Skip to content

Commit 61fb23f

Browse files
chore: modernize test suite [] (#1571)
* chore: publish to github packages * chore: updating to github action workflow * chore: fix names in test workflows * chore: turning semis off in prettier ☹️ * chore: fixing restore cache build folders * chore: update prettierrc file * chore: ignore formatting check * chore: fix unit test command * chore: passing secrets to workflows * chore: updating build folder to dist * chore: modernize unit tests to viteset and TS * chore: modernize integration tests * chore: update to vitest latest * chore: update vitest to use projects instead of config files * chore: modernize end-to-end tests * chore: update node versions in gha runners * chore: update timeouts * chore: modernize e2e specs * chore: remove unneeded files * chore: remove unneeded setup files * chore: fix lock and dep issues * chore: update eslint to latest to fix legacy peer deps install issue * chore: remove left over dev branch and update it to have a real dev channel --------- Co-authored-by: Ely Lucas <ely.lucas@contentful.com>
1 parent f1e40cd commit 61fb23f

File tree

133 files changed

+17384
-16818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+17384
-16818
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/main.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ jobs:
1313
check:
1414
needs: build
1515
uses: ./.github/workflows/check.yaml
16-
16+
1717
test-integration:
1818
needs: [build, check]
1919
uses: ./.github/workflows/test-integration.yaml
2020
secrets: inherit
21-
21+
2222
test-e2e:
2323
needs: [build, check, test-integration]
2424
uses: ./.github/workflows/test-e2e.yaml
2525
secrets: inherit
2626

2727
release:
28-
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta')
28+
if: github.event_name == 'push' && contains(fromJSON('["refs/heads/main", "refs/heads/beta", "refs/heads/dev"]'), github.ref)
2929
needs: [build, check, test-integration, test-e2e]
3030
permissions:
3131
contents: write
@@ -34,4 +34,3 @@ jobs:
3434
uses: ./.github/workflows/release.yaml
3535
secrets:
3636
VAULT_URL: ${{ secrets.VAULT_URL }}
37-

eslint.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const { defineConfig, globalIgnores } = require('eslint/config')
2+
3+
const js = require('@eslint/js')
4+
5+
const contentfulBackend = require('@contentful/eslint-config-backend')
6+
7+
const { FlatCompat } = require('@eslint/eslintrc')
8+
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all
13+
})
14+
15+
module.exports = defineConfig([
16+
{
17+
...contentfulBackend.default,
18+
extends: compat.extends('prettier'),
19+
files: ['examples/**/*.js', 'test/**/*.js', 'src/**/*.js'],
20+
rules: {
21+
'max-len': [
22+
2,
23+
120,
24+
{
25+
ignoreStrings: true,
26+
ignoreTemplateLiterals: true
27+
}
28+
]
29+
}
30+
},
31+
globalIgnores(['test/fixtures/', 'dist/', 'coverage/'])
32+
])

examples/specify-migration-function.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { runMigration } = require('../dist/bin/cli')
1+
const { runMigration } = require('../src/bin/cli')
22

33
function migrationFunction(migration) {
44
const dog = migration.createContentType('dog', {

examples/usage-as-lib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { runMigration } = require('../dist/bin/cli')
1+
const { runMigration } = require('../src/bin/cli')
22

33
async function main(filePath) {
44
let statusCode = 0

0 commit comments

Comments
 (0)