Skip to content

Commit

Permalink
move test setup files to separte dir
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPuko committed Dec 15, 2016
1 parent 2bd4f8f commit c5a16ef
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions test/DevicesController.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import test from 'ava';
import request from 'supertest-as-promised';
import ouathClients from '../src/oauthClients.json';
import app from './testApp';
import settings from './settings';
import app from './setup/testApp';
import settings from './setup/settings';

const USER_CREDENTIALS = {
password: 'password',
Expand Down
4 changes: 2 additions & 2 deletions test/UsersController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { TokenObject, UserCredentials } from '../src/types';
import test from 'ava';
import request from 'supertest-as-promised';
import ouathClients from '../src/oauthClients.json';
import app from './testApp';
import settings from './settings';
import app from './setup/testApp';
import settings from './setup/settings';

const USER_CREDENTIALS: UserCredentials = {
password: 'password',
Expand Down
4 changes: 2 additions & 2 deletions test/WebhooksController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { Webhook, WebhookMutator } from '../src/types';
import test from 'ava';
import request from 'supertest-as-promised';
import ouathClients from '../src/oauthClients.json';
import app from './testApp';
import settings from './settings';
import app from './setup/testApp';
import settings from './setup/settings';

const USER_CREDENTIALS = {
password: 'password',
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions test/settings.js → test/setup/settings.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// @flow

import path from 'path';
import WebhookFileRepository from '../src/lib/repository/WebhookFileRepository';
import UsersFileRepository from '../src/lib/repository/UserFileRepository';
import WebhookFileRepository from '../../src/lib/repository/WebhookFileRepository';
import UsersFileRepository from '../../src/lib/repository/UserFileRepository';
import { DeviceAttributeFileRepository, DeviceKeyFileRepository } from 'spark-protocol';

export default {
accessTokenLifetime: 7776000, // 90 days,
baseUrl: 'http://localhost',
coreFlashTimeout: 90000,
coreKeysDir: path.join(__dirname, '__test_data__/core_keys'),
coreKeysDir: path.join(__dirname, '../__test_data__/core_keys'),
coreRequestTimeout: 30000,
coreSignalTimeout: 30000,
isCoreOnlineTimeout: 2000,
Expand All @@ -18,16 +18,16 @@ export default {
maxHooksPerDevice: 10,
maxHooksPerUser: 20,
deviceAttributeRepository: new DeviceAttributeFileRepository(
path.join(__dirname, '__test_data__/core_keys'),
path.join(__dirname, '../__test_data__/core_keys'),
),
deviceKeyFileRepository: new DeviceKeyFileRepository(
path.join(__dirname, '__test_data__/core_keys'),
path.join(__dirname, '../__test_data__/core_keys'),
),
usersRepository: new UsersFileRepository(
path.join(__dirname, '__test_data__/users'),
path.join(__dirname, '../__test_data__/users'),
),
webhookRepository: new WebhookFileRepository(
path.join(__dirname, '__test_data__/webhooks'),
path.join(__dirname, '../__test_data__/webhooks'),
),

/**
Expand Down
2 changes: 1 addition & 1 deletion test/testApp.js → test/setup/testApp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow

import createApp from '../src/app';
import createApp from '../../src/app';
import settings from './settings';
import DeviceServerMock from './DeviceServerMock';

Expand Down

0 comments on commit c5a16ef

Please sign in to comment.