Skip to content

Commit

Permalink
Add Backfilled data script
Browse files Browse the repository at this point in the history
  • Loading branch information
alallema committed Dec 1, 2021
1 parent f8ca76e commit 774bb13
Show file tree
Hide file tree
Showing 17 changed files with 5,694 additions and 17,712 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,20 @@ jobs:
with:
node-version: 14
- name: Install dependencies
run: npm run install:functions
run: yarn install:functions
- name: Run style check
run: npm run lint
run: yarn lint

integration-tests:
name: integration-tests
runs-on: ubuntu-latest
strategy:
matrix:
node: ["12", "14"]
name: integration-tests node.js_${{ matrix.node }}_test
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
node-version: 14
- name: Install dependencies
run: npm run install:functions
run: yarn install:functions
- name: Run tests with coverage
run: npm run test-coverage
run: yarn test:coverage
14 changes: 8 additions & 6 deletions functions/__tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@ describe('extensions config', () => {
beforeEach(() => {
jest.resetModules()
restoreEnv = mockedEnv(defaultEnvironment)
config = require('../src/config').default
config = require('../src/config').config
})
afterEach(() => restoreEnv())

test('config loaded from environment variables', () => {
const testConfig = {
location: defaultEnvironment.LOCATION,
collectionPath: defaultEnvironment.COLLECTION_PATH,
fieldsToIndex: defaultEnvironment.FIELDS_TO_INDEX,
searchableFields: defaultEnvironment.SEARCHABLE_FIELDS,
meilisearchIndex: defaultEnvironment.MEILISEARCH_INDEX_NAME,
meilisearchHost: defaultEnvironment.MEILISEARCH_HOST,
meilisearchApiKey: defaultEnvironment.MEILISEARCH_API_KEY,
meilisearch: {
host: defaultEnvironment.MEILISEARCH_HOST,
apiKey: defaultEnvironment.MEILISEARCH_API_KEY,
indexUid: defaultEnvironment.MEILISEARCH_INDEX_NAME,
fieldsToIndex: defaultEnvironment.FIELDS_TO_INDEX,
searchableFields: defaultEnvironment.SEARCHABLE_FIELDS,
},
}

expect(config).toStrictEqual(testConfig)
Expand Down
2 changes: 1 addition & 1 deletion functions/__tests__/functions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('extension', () => {

beforeEach(() => {
restoreEnv = mockedEnv(defaultEnvironment)
config = require('../src/config').default
config = require('../src/config').config
})
afterEach(() => restoreEnv())

Expand Down
4 changes: 2 additions & 2 deletions functions/__tests__/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('getSearchableFields', () => {

test('configuration detected from environment variables', () => {
const mockConfig = config()
expect(mockConfig).toMatchSnapshot({})
expect(mockConfig).toMatchSnapshot()
})

test('return list with one field', () => {
Expand Down Expand Up @@ -221,7 +221,7 @@ describe('getFieldsToIndex', () => {

test('configuration detected from environment variables', () => {
const mockConfig = config()
expect(mockConfig).toMatchSnapshot({})
expect(mockConfig).toMatchSnapshot()
})

test('return empty list', () => {
Expand Down
Loading

0 comments on commit 774bb13

Please sign in to comment.