- Build electron using it's own babel config (using
env)
{
"electron-main": {
"presets": [
["es2015"],
"react"
],
"plugins": [| import fetch from 'node-fetch'; | |
| import { getCategories } from './data'; | |
| beforeEach(() => { | |
| // Reset the modules back to their original state. | |
| // In this case, we are setting `node-fetch` back | |
| // to the original, unmocked version | |
| jest.resetModules(); | |
| }); |
| import { getCategories } from './data'; | |
| describe('getCategories', () => { | |
| it('should return expected data from server', async () => { | |
| const categories = await getCategories(); | |
| expect(categories).toEqual([ | |
| { id: 1, name: 'Category 1' }, | |
| { id: 2, name: 'Category 2' }, | |
| { id: 3, name: 'Category 3' }, | |
| { id: 4, name: 'Category 4' }, |
| import fetch from 'node-fetch'; | |
| const normalize = json => { | |
| return json.categories.map(category => { | |
| return { | |
| id: category.catId, | |
| name: category.catName, | |
| }; | |
| }); | |
| }; |
| { | |
| "categories": [ | |
| { "catId": 1, "catName": "Category 1" }, | |
| { "catId": 2, "catName": "Category 2" }, | |
| { "catId": 3, "catName": "Category 3" }, | |
| { "catId": 4, "catName": "Category 4" } | |
| ] | |
| } |
| git branch -m old_branch new_branch # perform the rename | |
| git push origin :old_branch # delete remote branch | |
| git push --set-upstream origin new_branch # push to remote, setting the remote branch |
| export default class SampleClass { | |
| getSomething() { | |
| return 'something'; | |
| } | |
| } |
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Debug Jest", | |
| "type": "node", | |
| "request": "launch", | |
| "program": "${workspaceRoot}/node_modules/jest-cli/bin/jest.js", | |
| "stopOnEntry": false, | |
| "args": ["--runInBand"], |
| // Requires references to: | |
| // - System.ValueTuple | |
| // - Microsoft.VisualStudio.QualityTools.UnitTestFramework | |
| public class Person | |
| { | |
| public string Name { get; set; } | |
| public string City { get; set; } | |
| public void Deconstruct(out string name, out string city) | |
| { |
| using Project.Data; // enternal dependency | |
| namespace Project.Logic | |
| { | |
| public class User | |
| { | |
| // .. | |
| public List<UserModel> GetAll() { | |
| IEnumerable<User> users = _entities.Users; |