Browse Source

Small fixes after deployment for some things that broke development.

pull/26/head
Zed A. Shaw 3 months ago
parent
commit
668627abb2
5 changed files with 60 additions and 40 deletions
  1. +43
    -0
      __tests__/fixtures/secrets.js
  2. +11
    -7
      __tests__/ui/register.spec.js
  3. +1
    -29
      ecosystem.config.js
  4. +4
    -3
      knexfile.js
  5. +1
    -1
      package.json

+ 43
- 0
__tests__/fixtures/secrets.js View File

@@ -0,0 +1,43 @@
// host is set to empty so nothing is sent to train during testing

exports.env = 'development';

exports.mailtrain = {
access_token: "",
list_id: 'La_Zy6f5',
host: '',
}

exports.wowza = {
player_id: "vrvfb4vf",
password: "testing"
}

exports.cookie_key = '4d1da00fc2c742a1bac7c873894d7434';

exports.base_host = 'http://localhost:3000';
exports.root_url = `${exports.base_host}/`;


exports.database = {
development: {
name: 'ljsthw',
user: 'ljsthw',
password: 'testing',
host: 'localhost',
},
production: {
name: 'ljsthw',
user: 'ljsthw',
password: 'unset',
host: 'localhost',
}
}

exports.webtorrent = {
use_dht: true
}

exports.redis = 'redis://127.0.0.1:6379';



+ 11
- 7
__tests__/ui/register.spec.js View File

@@ -45,13 +45,17 @@ it('Can register for an account after soft login', async () => {
});

it('Can register off the index.', async () => {
let [browser, page] = await t.begin(host);
const user2 = t.fake_person();
let [browser, page] = await t.begin(host);
const user2 = t.fake_person();

await t.sleep(100);
await page.waitForSelector(t.sel('register-input'));
await page.type(t.sel('register-input'), user2.email);
await page.click(t.sel('register-submit'));
await t.sleep(100);
await page.waitForSelector(t.sel('nav-logout'));
await page.click(t.sel('nav-logout'));

await t.has_content(page, t.sel('login-page'), "Login or Sign Up");
await t.sleep(100);
await page.waitForSelector(t.sel('register-input'));
await page.type(t.sel('register-input'), user2.email);
await page.click(t.sel('register-submit'));

await t.has_content(page, t.sel('login-page'), "Login or Sign Up");
});

+ 1
- 29
ecosystem.config.js View File

@@ -2,7 +2,7 @@ module.exports = {
apps : [
{
name: 'auth',
script: 'scripts/services/auth.js',
script: './scripts/services/auth.js',
instances: 1,
autorestart: true,
watch: ["lib", "scripts/services"],
@@ -41,34 +41,6 @@ module.exports = {
env_production: {
NODE_ENV: 'production'
}
},
{
name: 'ljsthw-dev',
script: 'npm run dev',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'development'
},
env_production: {
NODE_ENV: 'production'
}
},
{
name: 'ljsthw',
script: 'node __sapper__/build/',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'development'
},
env_production: {
NODE_ENV: 'production'
}
}
],
};

+ 4
- 3
knexfile.js View File

@@ -5,10 +5,10 @@ module.exports = {
development: {
client: 'postgresql',
connection: {
database: 'ljsthw_testing',
database: secrets.database.development.name,
user: secrets.database.development.user,
password: secrets.database.development.password,
host: 'db.learnjsthehardway.com'
host: secrets.database.development.host,
},
pool: {
min: 2,
@@ -38,9 +38,10 @@ module.exports = {
production: {
client: 'postgresql',
connection: {
database: 'ljsthw',
database: secrets.database.production.name,
user: secrets.database.production.user,
password: secrets.database.production.password,
host: secrets.database.production.host,
},
pool: {
min: 2,

+ 1
- 1
package.json View File

@@ -9,7 +9,7 @@
"export": "sapper export --legacy -p 7778",
"start": "node __sapper__/build",
"test": "NODE_OPTIONS='--unhandled-rejections=strict' jest --detectOpenHandles --bail --forceExit",
"fixtures": "rm -rf deployment/testing/* protected && ln -sf ./deployment/testing protected && node scripts/generator.js -d -w -s __tests__/fixtures -t protected",
"fixtures": "rm -rf deployment/testing/* protected && ln -sf ./deployment/testing protected && ./scripts/rr ./scripts/services/generator.js -d -w -s __tests__/fixtures -t protected",
"testwatch": "NODE_OPTIONS='--unhandled-rejections=strict' jest --watch --notify --detectOpenHandles",
"deploy": "npx sapper export && rsync -azzv __sapper__/export/ $DEP_USER@learnjsthehardway.com:/srv/http/www/learnjsthehardway.com/"
},

Loading…
Cancel
Save