This commit is contained in:
Nolan Lawson 2018-02-18 15:30:42 -08:00
parent f4eeacdc1c
commit 03073ac846
7 changed files with 39 additions and 34 deletions

View file

@ -19,7 +19,7 @@ const mastodonDir = path.join(dir, '../mastodon')
let childProc let childProc
async function cloneMastodon() { async function cloneMastodon () {
try { try {
await stat(mastodonDir) await stat(mastodonDir)
} catch (e) { } catch (e) {
@ -30,7 +30,7 @@ async function cloneMastodon() {
} }
} }
async function restoreMastodonData() { async function restoreMastodonData () {
console.log('Restoring mastodon data...') console.log('Restoring mastodon data...')
try { try {
await exec('dropdb mastodon_development', {cwd: mastodonDir}) await exec('dropdb mastodon_development', {cwd: mastodonDir})
@ -46,7 +46,7 @@ async function restoreMastodonData() {
await exec(`tar -xzf "${tgzFile}"`, {cwd: systemDir}) await exec(`tar -xzf "${tgzFile}"`, {cwd: systemDir})
} }
async function runMastodon() { async function runMastodon () {
console.log('Running mastodon...') console.log('Running mastodon...')
let cmds = [ let cmds = [
'gem install bundler', 'gem install bundler',
@ -71,7 +71,7 @@ async function runMastodon() {
await waitForMastodonToStart() await waitForMastodonToStart()
} }
async function main() { async function main () {
await cloneMastodon() await cloneMastodon()
await restoreMastodonData() await restoreMastodonData()
await runMastodon() await runMastodon()

View file

@ -1,6 +1,6 @@
const fetch = require('node-fetch') const fetch = require('node-fetch')
async function waitForMastodonToStart() { async function waitForMastodonToStart () {
while (true) { while (true) {
try { try {
let json = await ((await fetch('http://127.0.0.1:3000/api/v1/instance')).json()) let json = await ((await fetch('http://127.0.0.1:3000/api/v1/instance')).json())

View file

@ -27,5 +27,4 @@ describe('Basic spec', () => {
cy.url().should('contain', '/settings/instances') cy.url().should('contain', '/settings/instances')
cy.contains("You're not logged in to any instances") cy.contains("You're not logged in to any instances")
}) })
}) })

View file

@ -33,5 +33,4 @@ describe('Login spec', () => {
cy.url().should('contain', '/settings/instances') cy.url().should('contain', '/settings/instances')
cy.contains("You're not logged in to any instances") cy.contains("You're not logged in to any instances")
}) })
}) })

View file

@ -25,9 +25,9 @@ describe('Basic timeline spec', () => {
cy.getNthVirtualArticle(10).get('.status-content p').should('contain', "here's a secret kitten") cy.getNthVirtualArticle(10).get('.status-content p').should('contain', "here's a secret kitten")
cy.getNthVirtualArticle(11).get('.status-content p').should('contain', "here's a kitten") cy.getNthVirtualArticle(11).get('.status-content p').should('contain', "here's a kitten")
cy.getNthVirtualArticle(11).scrollIntoView() cy.getNthVirtualArticle(11).scrollIntoView()
cy.getNthVirtualArticle(12).get('.status-content p').should('contain', "hello admin") cy.getNthVirtualArticle(12).get('.status-content p').should('contain', 'hello admin')
cy.getNthVirtualArticle(13).get('.status-content p').should('contain', "hello foobar") cy.getNthVirtualArticle(13).get('.status-content p').should('contain', 'hello foobar')
cy.getNthVirtualArticle(14).get('.status-content p').should('contain', "hello world") cy.getNthVirtualArticle(14).get('.status-content p').should('contain', 'hello world')
cy.getNthVirtualArticle(14).scrollIntoView() cy.getNthVirtualArticle(14).scrollIntoView()
for (let i = 0; i < 30; i++) { for (let i = 0; i < 30; i++) {
@ -36,6 +36,5 @@ describe('Basic timeline spec', () => {
} }
cy.get('.virtual-list-item[aria-hidden=false] .status-article:first').should('have.attr', 'aria-setsize', (30 + 15).toString()) cy.get('.virtual-list-item[aria-hidden=false] .status-article:first').should('have.attr', 'aria-setsize', (30 + 15).toString())
}) })
}) })

View file

@ -91,11 +91,19 @@
"caches", "caches",
"__routes__", "__routes__",
"__shell__", "__shell__",
"__assets__" "__assets__",
"cy",
"Cypress",
"expect",
"before",
"beforeEach",
"after",
"afterEach",
"describe",
"it"
], ],
"ignore": [ "ignore": [
"dist", "dist",
"cypress",
"routes/_utils/asyncModules.js" "routes/_utils/asyncModules.js"
] ]
} }