-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
11 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,3 @@ yarn-error.log | |
.vscode | ||
packages/zcli-apps/tests/functional/mocks/*/tmp | ||
packages/**/dist | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
packages/zcli-apps/tests/functional/mocks/single_product_ignore/.zcliignore
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-9.02 KB
.../zcli-apps/tests/functional/mocks/single_product_ignore/assets/icon_nav_bar.svg
Binary file not shown.
Empty file removed
0
...apps/tests/functional/mocks/single_product_ignore/assets/icon_ticket_editor.svg
Empty file.
1 change: 0 additions & 1 deletion
1
packages/zcli-apps/tests/functional/mocks/single_product_ignore/assets/iframe.html
This file was deleted.
Oops, something went wrong.
Empty file removed
0
...es/zcli-apps/tests/functional/mocks/single_product_ignore/assets/logo-small.png
Empty file.
Empty file removed
0
...pps/tests/functional/mocks/single_product_ignore/assets/testFolder/1gn0r3m3.jpg
Empty file.
18 changes: 0 additions & 18 deletions
18
packages/zcli-apps/tests/functional/mocks/single_product_ignore/manifest.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/zcli-apps/tests/functional/mocks/single_product_ignore/zcli.apps.config.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
import { expect, test } from '@oclif/test' | ||
import * as path from 'path' | ||
import * as fs from 'fs' | ||
import * as readline from 'readline' | ||
import * as AdmZip from 'adm-zip' | ||
|
||
describe('package', function () { | ||
const appPath = path.join(__dirname, 'mocks/single_product_app') | ||
|
@@ -19,7 +16,7 @@ describe('package', function () { | |
}) | ||
.stdout() | ||
.command(['apps:package', appPath]) | ||
.it('should display success message if package is created', ctx => { | ||
.it('should display success message package is created', ctx => { | ||
const pkgPath = path.join(path.relative(process.cwd(), appPath), 'tmp', 'app') | ||
expect(ctx.stdout).to.contain(`Package created at ${pkgPath}`) | ||
}) | ||
|
@@ -39,53 +36,3 @@ describe('package', function () { | |
.catch(err => expect(err.message).to.contain('Error: invalid location')) | ||
.it('should display error message if package fails to create') | ||
}) | ||
|
||
describe('zcliignore', function () { | ||
const appPath = path.join(__dirname, 'mocks/single_product_ignore') | ||
const tmpPath = path.join(appPath, 'tmp') | ||
|
||
const file = readline.createInterface({ | ||
input: fs.createReadStream(path.join(appPath, '.zcliignore')), | ||
output: process.stdout, | ||
terminal: false | ||
}) | ||
|
||
const ignoreArr: string[] = [] // array that holds each line of the .ignore file | ||
|
||
file.on('line', (line) => { | ||
ignoreArr.push(line) // add to array dynamically | ||
}) | ||
|
||
after(async () => { | ||
fs.readdir(tmpPath, (err, files) => { | ||
if (err) throw err | ||
|
||
for (const file of files) { | ||
fs.unlink(path.join(tmpPath, file), (err) => { | ||
if (err) throw err | ||
}) | ||
} | ||
}) | ||
}) | ||
|
||
test | ||
.env({ | ||
ZENDESK_SUBDOMAIN: 'z3ntest', | ||
ZENDESK_EMAIL: '[email protected]', | ||
ZENDESK_PASSWORD: '123456' // the universal password | ||
}) | ||
.nock('https://z3ntest.zendesk.com', api => { | ||
api | ||
.post('/api/v2/apps/validate') | ||
.reply(200) | ||
}) | ||
.stdout() | ||
.command(['apps:package', appPath]) | ||
.it('should not include certain files as specified in .zcliignore', async () => { | ||
const packagePath = path.join(tmpPath, (fs.readdirSync(tmpPath).find(fn => fn.startsWith('app'))) + '') | ||
const zip = new AdmZip(packagePath) | ||
for (const zipEntry of zip.getEntries()) { | ||
expect(ignoreArr.includes(zipEntry.name)).to.eq(false) | ||
} | ||
}) | ||
}) |
Binary file not shown.
Binary file not shown.