Bruno Guimarães 11a50ebc29 Added user snippets API support (#189)
* Added user snippets API support

* Combined functions 'all' and 'allPublic'

* Added 'Snippets' as supported API

* Fixed lint error (` should be ')

* Added test for creating snippets
2018-09-18 18:37:29 -04:00

16 lines
494 B
TypeScript

import { Snippets } from '../../../src';
describe('Snippets', () => {
it('should create snippet', async () => {
const service = new Snippets({
url: process.env.GITLAB_URL,
token: process.env.PERSONAL_ACCESS_TOKEN,
});
const result = await service.create('This is a snippet', 'test.txt', 'Hello world', 'internal', { 'description': 'Hello World snippet' });
expect(result).toBeInstanceOf(Object);
expect(result.title).toEqual('This is a snippet');
});
});