{
  "Log": {
    "prefix": "log",
    "scope": "typescript",
    "body": [
      "console.log($1);"
    ]
  },
  "Create service based test suite": {
    "prefix": "yc-service-test-suite",
    "scope": "typescript",
    "body": [
      "import { Spec, TestCase } from '@yourcause/test-decorators';",
      "import { DescribeAngularService } from '@yourcause/test-decorators/angular';",
      "import { MockModule } from '@yourcause/common/testing';",
      "import { expect } from 'chai';",
      "import { $1 } from '$2';",
      "",
      "@DescribeAngularService($1, {",
      "  imports: [MockModule]$3",
      "})",
      "export class $1Spec implements Spec<$1Spec, $1> {",
      "  @TestCase('should $4')",
      "  test$5 (${6:service}: $1) {",
      "    expect(${6:service}$7)$0;",
      "  }",
      "}",
      ""
    ]
  },
  "Create service based test case": {
    "prefix": "yc-service-test-case",
    "scope": "typescript",
    "body": [
      "@TestCase('should $1')",
      "test$2 (${3:service}: $4) {",
      "  expect(${3:service}$5)$0;",
      "}"
    ]
  },
  "Create component based test suite": {
    "prefix": "yc-component-test-suite",
    "scope": "typescript",
    "body": [
      "import { GCMockModule } from '@core/mocks/gc-module.mock';",
      "import { ComponentFixture } from '@angular/core/testing';",
      "import { DescribeAngularComponent, TestCase, Spec } from '@yourcause/test-decorators';",
      "import { expect } from 'chai';",
      "import { $1 } from '$2';",
      "",
      "@DescribeAngularComponent($1, {",
      "  imports: [GCMockModule]$3",
      "})",
      "export class $1Spec implements Spec<$1Spec, ComponentFixture<$1>> {",
      "  @TestCase('should $4')",
      "  test$5 (${6:fixture}: ComponentFixture<$1>) {",
      "    expect(${6:fixture}$7)$0;",
      "  }",
      "}",
      ""
    ]
  },
  "Create component based test case": {
    "prefix": "yc-component-test-case",
    "scope": "typescript",
    "body": [
      "@TestCase('should $1')",
      "test$2 (${3:fixture}: ComponentFixture<$4>) {",
      "  expect(${3:fixture}$5)$0;",
      "}"
    ]
  },

  "Try catch with spinner": {
    "prefix": "yc-try-catch-with-spinner",
    "scope": "typescript",
    "body": [
      "this.${1:spinnerService}.startSpinner();",
      "try {",
      "  $6",
      "  this.${2:notifier}.success(this.${3:i18n}.translate($4));",
      "} catch (e) {",
      "  this.${2:notifier}.error(this.${3:i18n}.translate($5));",
      "  console.error(e);",
      "}",
      "this.${1:spinnerService}.stopSpinner();"
    ]
  },

  "YC State": {
    "prefix": "yc-state",
    "scope": "typescript",
    "body": [
      "import { BaseYcState, RegisterYCState } from '@yourcause/common/state';",
      "",
      "@RegisterYCState()",
      "export class $1State extends BaseYcState {",
      "  $2",
      "}",
      ""
    ]
  },

  "YC Resources": {
    "prefix": "yc-resources",
    "scope": "typescript",
    "body": [
      "import { Injectable } from '@angular/core';",
      "import { HttpRestService } from '@core/services/http-rest.service';",
      "",
      "@Injectable({ providedIn: ${2:'root'} })",
      "export class $1Resources {",
      "  constructor (",
      "    private http: HttpRestService",
      "  ) { }",
      "",
      "  $3",
      "}",
      ""
    ]
  },


  "YC Service": {
    "prefix": "yc-service",
    "scope": "typescript",
    "body": [
      "import { Injectable } from '@angular/core';",
      "import { BaseYCService, AttachYCState } from '@yourcause/common/state';",
      "import { $1State } from '$2';",
      "import { $1Resources } from '$3';",
      "",
      "@Injectable({ providedIn: ${4:'root'} })",
      "@AttachYCState($1State)",
      "export class $1Service extends BaseYCService<$1State> {",
      "  constructor (",
      "    private resources: $1Resources$5",
      "  ) {",
      "    super();",
      "  }",
      "",
      "  $6",
      "}",
      ""
    ]
  },
  "YC Resolver": {
    "prefix": "yc-resolver",
    "scope": "typescript",
    "body": [
      "import { Injectable } from '@angular/core';",
      "import { Resolve, ActivatedRouteSnapshot } from '@angular/router';",
      "import { $1Service } from '$2';",
      "",
      "@Injectable({ providedIn: ${4:'root'} })",
      "export class $1Resolver implements Resolve<$3> {",
      "  constructor (",
      "    private service: $1Service$5",
      "  ) { }",
      "",
      "  async resolve (_next: ActivatedRouteSnapshot) {",
      "    $6",
      "  }",
      "}",
      ""
    ]
  },
}
