test('add v-pre to inline code', async () => { const plugin = await createPlugin() const res = await plugin.parse('`{{ test }}`', { onlyTemplate: true }) expect(res).toMatch('<code v-pre>{{ test }}</code>') })
it('cloud function should obfuscate password', done => { Parse.Cloud.define('testFunction', () => { return 'verify code success'; }); Parse.Cloud.run('testFunction', { username: 'hawk', password: '123456' }) .then(() => { const entry = spy.calls.mostRecent().args; expect(entry[2].params.password).toMatch(/\*\*\*\*\*\*\*\*/); done(); }) .then(null, e => done.fail(e)); });
// FIXME this test doesn't seem to be actually testing injection unless i'm missing something it('inject', async () => { const res = await render({ name: 'devise', actionfolder: fixture('app/action-inject'), }) expect(res[0].file).toMatch(/inject/) res[0].file = 'inject.ejs.t' expect(res[0].body).toMatch("gem 'devise'") })
test('show local gridsome version', async () => { const testPath = path.join(__dirname, '__fixtures__', 'project') const { stdout } = await runCLI(['-v'], testPath) expect(stdout).toMatch(/gridsome v(\d+\.?){3}/) })
test('parse images as g-image', async () => { const plugin = await createPlugin() const res = await plugin.parse('![Test](./image.png)', { onlyTemplate: true }) expect(res).toMatch('<p><g-image src="./image.png" alt="Test"></g-image></p>') })
test('parse local files as g-link', async () => { const plugin = await createPlugin() const res = await plugin.parse('[Test](./document.pdf)', { onlyTemplate: true }) expect(res).toMatch('<p><g-link to="./document.pdf">Test</g-link></p>') })
test('add v-pre to inline code', async () => { const plugin = await createPlugin() const res = await plugin.parse('`{{ test }}`', { onlyTemplate: true }) expect(res).toMatch('<code v-pre>{{ test }}</code>') })
test('parse local files as g-link', async () => { const plugin = await createPlugin() const res = await plugin.parse('[Test](./document.pdf)', { onlyTemplate: true }) expect(res).toMatch('<p><g-link to="./document.pdf">Test</g-link></p>') })
test('show local gridsome version', async () => { const testPath = path.join(__dirname, '__fixtures__', 'project') const { stdout } = await runCLI(['-v'], testPath) expect(stdout).toMatch(/gridsome v(\d+\.?){3}/) })
test('parse Vue component in paragraph', async () => { const plugin = await createPlugin() const res = await plugin.parse(` Lorem <MyComponent /> impsum... `, { onlyTemplate: true }) expect(res).toMatch('<p>Lorem <MyComponent /> impsum...</p>') })