Skip to content

Commit

Permalink
refactor: change NPM scope from @netbasal to @ngneat (#160)
Browse files Browse the repository at this point in the history
The package has been moved to the ngneat organization.

BREAKING CHANGE: All imports have been changed from @netbasal/spectator
to @ngneat/spectator.
  • Loading branch information
dirkluijk committed Aug 26, 2019
1 parent 437f851 commit 9c19f98
Show file tree
Hide file tree
Showing 74 changed files with 89 additions and 83 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Then, in the root of your consuming app,
Tell `npm` to link to the package:

```
npm link @netbasal/spectator
npm link @ngneat/spectator
```

Run tests while preserving symlinks:
Expand Down
4 changes: 2 additions & 2 deletions projects/spectator/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
testMatch: ['**/jest/**/*.spec.ts'],
setupFilesAfterEnv: ['<rootDir>/projects/spectator/setup-jest.ts'],
moduleNameMapper: {
'@netbasal/spectator/jest': '<rootDir>/projects/spectator/jest/src/public_api.ts',
'@netbasal/spectator': '<rootDir>/projects/spectator/src/public_api.ts'
'@ngneat/spectator/jest': '<rootDir>/projects/spectator/jest/src/public_api.ts',
'@ngneat/spectator': '<rootDir>/projects/spectator/src/public_api.ts'
}
};
2 changes: 1 addition & 1 deletion projects/spectator/jest/src/lib/dom-selectors.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { byAltText, byLabel, byPlaceholder, byText, byTitle, byValue, byTestId } from '@netbasal/spectator';
export { byAltText, byLabel, byPlaceholder, byText, byTitle, byValue, byTestId } from '@ngneat/spectator';
2 changes: 1 addition & 1 deletion projects/spectator/jest/src/lib/http.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FactoryProvider, Type } from '@angular/core';
import { createHTTPFactory as baseCreateHTTPFactory, SpectatorHTTP } from '@netbasal/spectator';
import { createHTTPFactory as baseCreateHTTPFactory, SpectatorHTTP } from '@ngneat/spectator';

/**
* @deprecated Deprecated in favour of createHttpFactory
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/src/lib/mock.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FactoryProvider, Type } from '@angular/core';
import { installProtoMethods, CompatibleSpy, SpyObject as BaseSpyObject } from '@netbasal/spectator';
import { installProtoMethods, CompatibleSpy, SpyObject as BaseSpyObject } from '@ngneat/spectator';

export type SpyObject<T> = BaseSpyObject<T> & { [P in keyof T]: T[P] & (T[P] extends (...args: any[]) => infer R ? jest.Mock<R> : T[P]) };

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/src/lib/spectator-directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SpectatorDirectiveOptions,
SpectatorDirectiveOverrides,
Token
} from '@netbasal/spectator';
} from '@ngneat/spectator';

import { mockProvider, SpyObject } from './mock';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/src/lib/spectator-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SpectatorHostOptions,
SpectatorHostOverrides,
Token
} from '@netbasal/spectator';
} from '@ngneat/spectator';

import { mockProvider, SpyObject } from './mock';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/src/lib/spectator-http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SpectatorHttp as BaseSpectatorHttp,
SpectatorHttpOptions,
Token
} from '@netbasal/spectator';
} from '@ngneat/spectator';

import { mockProvider, SpyObject } from './mock';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/src/lib/spectator-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
SpectatorRoutingOptions,
SpectatorRoutingOverrides,
Token
} from '@netbasal/spectator';
} from '@ngneat/spectator';

import { mockProvider, SpyObject } from './mock';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/src/lib/spectator-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SpectatorServiceOptions,
SpectatorService as BaseSpectatorService,
Token
} from '@netbasal/spectator';
} from '@ngneat/spectator';

import { mockProvider, SpyObject } from './mock';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/src/lib/spectator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
SpectatorFactory,
SpectatorOptions,
Token
} from '@netbasal/spectator';
} from '@ngneat/spectator';

import { mockProvider, SpyObject } from './mock';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHostFactory, SpectatorHost } from '@netbasal/spectator/jest';
import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';
import { fakeAsync, tick } from '@angular/core/testing';

import { AsyncInputComponent } from '../../../test/async-input/async-input.component';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/async/async.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHostFactory, SpectatorHost } from '@netbasal/spectator/jest';
import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';

import { AsyncComponent } from '../../../test/async/async.component';
import { QueryService } from '../../../test/query.service';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/auth.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createService } from '@netbasal/spectator/jest';
import { createService } from '@ngneat/spectator/jest';

import { AuthService } from '../../test/auth.service';
import { DateService } from '../../test/date.service';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/auto-focus.directive.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { SpectatorHost, createHostFactory, createDirectiveFactory, SpectatorDirective } from '@netbasal/spectator/jest';
import { SpectatorHost, createHostFactory, createDirectiveFactory, SpectatorDirective } from '@ngneat/spectator/jest';

import { AutoFocusDirective } from '../../test/auto-focus.directive';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createComponentFactory, mockProvider, Spectator } from '@netbasal/spectator/jest';
import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest';
import { of } from 'rxjs';

import { ButtonComponent } from '../../../test/button/button.component';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/calc.component.jest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createComponentFactory, Spectator } from '@netbasal/spectator/jest';
import { createComponentFactory, Spectator } from '@ngneat/spectator/jest';

import { CalcComponent } from './calc.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHostFactory, SpectatorHost } from '@netbasal/spectator/jest';
import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';

import { ConsumeDynamicComponent } from '../../../test/consum-dynamic/consume-dynamic.component';
import { DynamicComponent } from '../../../test/dynamic/dynamic.component';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/consumer.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createService, mockProvider } from '@netbasal/spectator/jest';
import { createService, mockProvider } from '@ngneat/spectator/jest';
import { Subject } from 'rxjs';

import { ConsumerService } from '../../test/consumer.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createComponentFactory, Spectator, byAltText, byLabel, byPlaceholder, byText, byTitle, byValue } from '@netbasal/spectator/jest';
import { createComponentFactory, Spectator, byAltText, byLabel, byPlaceholder, byText, byTitle, byValue } from '@ngneat/spectator/jest';

import { DomSelectorsComponent } from '../../../test/dom-selectors/dom-selectors.component';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/fg/fg.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SpectatorHost, createHostFactory } from '@netbasal/spectator/jest';
import { SpectatorHost, createHostFactory } from '@ngneat/spectator/jest';
import { Component } from '@angular/core';
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { createHostFactory, SpectatorHost, Spectator, createComponentFactory } from '@netbasal/spectator/jest';
import { createHostFactory, SpectatorHost, Spectator, createComponentFactory } from '@ngneat/spectator/jest';

import { FormInputComponent } from '../../../test/form-input/form-input.component';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/hello/hello.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHostFactory, SpectatorHost } from '@netbasal/spectator/jest';
import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';

import { HelloComponent } from '../../../test/hello/hello.component';

Expand Down
4 changes: 2 additions & 2 deletions projects/spectator/jest/test/highlight.directive.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createDirectiveFactory, SpectatorDirective, SpectatorHost } from '@netbasal/spectator';
import { createHostFactory } from '@netbasal/spectator/jest';
import { createDirectiveFactory, SpectatorDirective, SpectatorHost } from '@ngneat/spectator';
import { createHostFactory } from '@ngneat/spectator/jest';

import { HighlightDirective } from '../../test/highlight.directive';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/injection-and-mocking.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHostFactory, createService, createComponentFactory, Spectator } from '@netbasal/spectator/jest';
import { createHostFactory, createService, createComponentFactory, Spectator } from '@ngneat/spectator/jest';
import { InjectionToken } from '@angular/core';

import { ConsumerService } from '../../test/consumer.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createHostFactory } from '@netbasal/spectator/jest';
import { mockProvider } from '@netbasal/spectator';
import { createHostFactory } from '@ngneat/spectator/jest';
import { mockProvider } from '@ngneat/spectator';

import { ComponentWithoutOverwrittenProvidersComponent } from '../../../test/no-overwritten-providers/no-overwritten-providers.component';
import { DummyService } from '../../../test/no-overwritten-providers/dummy.service';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/spy-object/spy-object.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSpyObject } from '@netbasal/spectator/jest';
import { createSpyObject } from '@ngneat/spectator/jest';

import { Person } from '../../../test/spy-object/person';

Expand Down
4 changes: 2 additions & 2 deletions projects/spectator/jest/test/todos-data-old.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fakeAsync, tick } from '@angular/core/testing';
import { defer } from 'rxjs';
import { HTTPMethod } from '@netbasal/spectator';
import { createHTTPFactory, mockProvider, SpyObject } from '@netbasal/spectator/jest';
import { HTTPMethod } from '@ngneat/spectator';
import { createHTTPFactory, mockProvider, SpyObject } from '@ngneat/spectator/jest';

import { TodosDataService, UserService } from '../../test/todos-data.service';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/todos-data.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fakeAsync, tick } from '@angular/core/testing';
import { createHttpFactory, HttpMethod } from '@netbasal/spectator/jest';
import { createHttpFactory, HttpMethod } from '@ngneat/spectator/jest';
import { defer } from 'rxjs';

import { TodosDataService, UserService } from '../../test/todos-data.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHostFactory, SpectatorHost } from '@netbasal/spectator/jest';
import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';

import { AppUnlessDirective } from '../../../test/unless/unless.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ElementRef } from '@angular/core';
import { createHostFactory, createComponentFactory, Spectator, SpectatorHost } from '@netbasal/spectator/jest';
import { createHostFactory, createComponentFactory, Spectator, SpectatorHost } from '@ngneat/spectator/jest';

import { ViewChildrenComponent } from '../../../test/view-children/view-children.component';
import { ChildServiceService } from '../../../test/child-service.service';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/widget.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createService } from '@netbasal/spectator/jest';
import { createService } from '@ngneat/spectator/jest';

import { WidgetDataService } from '../../test/widget-data.service';
import { WidgetService } from '../../test/widget.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHostFactory, SpectatorHost } from '@netbasal/spectator/jest';
import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';

import { WidgetComponent } from '../../../test/widget/widget.component';
import { WidgetService } from '../../../test/widget.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router, RouterLink } from '@angular/router';
import { createRoutingFactory } from '@netbasal/spectator/jest';
import { createRoutingFactory } from '@ngneat/spectator/jest';

import { MyPageComponent } from '../../../test/with-routing/my-page.component';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/jest/test/zippy/zippy.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { fakeAsync, tick } from '@angular/core/testing';
import { createHostFactory, SpectatorHost } from '@netbasal/spectator/jest';
import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest';

import { ZippyComponent } from '../../../test/zippy/zippy.component';
import { QueryService } from '../../../test/query.service';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@netbasal/spectator",
"name": "@ngneat/spectator",
"description": "Angular tests made easy",
"author": "Netanel Basal <[email protected]>",
"version": "3.12.0",
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/schematics/src/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": ["@schematics/angular"],
"schematics": {
"ng-add": {
"description": "Install the @netbasal/spectator library",
"description": "Install the @ngneat/spectator library",
"factory": "./ng-add/index",
"schema": "./ng-add/schema.json"
},
Expand Down
4 changes: 2 additions & 2 deletions projects/spectator/schematics/src/ng-add/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions projects/spectator/schematics/src/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Schema } from './schema';

function addPackageJsonDependencies(): Rule {
return (host: Tree, context: SchematicContext) => {
const dependencies: NodeDependency[] = [{ type: NodeDependencyType.Dev, version: '~3.2.1', name: '@netbasal/spectator' }];
const dependencies: NodeDependency[] = [{ type: NodeDependencyType.Dev, version: '~3.2.1', name: '@ngneat/spectator' }];

dependencies.forEach(dependency => {
addPackageJsonDependency(host, dependency);
Expand All @@ -29,12 +29,18 @@ function installPackageJsonDependencies(): Rule {
function showGreeting(): Rule {
return (host: Tree, context: SchematicContext) => {
context.logger.info('👏 Create your first spectator test by checkout docs: https://netbasal.gitbook.io/spectator/');
context.logger.info('🙀 Last but Not Least, Have you Heard of Akita? https://netbasal.com/introducing-akita-a-new-state-management-pattern-for-angular-applications-f2f0fab5a8');
context.logger.info(
'🙀 Last but Not Least, Have you Heard of Akita? https://netbasal.com/introducing-akita-a-new-state-management-pattern-for-angular-applications-f2f0fab5a8'
);

return host;
};
}

export default function(options: Schema): Rule {
return chain([options && options.skipPackageJson ? noop() : addPackageJsonDependencies(), options && options.skipInstall ? noop() : installPackageJsonDependencies(), options && options.skipGreeting ? noop() : showGreeting()]);
return chain([
options && options.skipPackageJson ? noop() : addPackageJsonDependencies(),
options && options.skipInstall ? noop() : installPackageJsonDependencies(),
options && options.skipGreeting ? noop() : showGreeting()
]);
}
4 changes: 2 additions & 2 deletions projects/spectator/schematics/src/ng-add/schema.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "http://json-schema.org/schema",
"id": "SchematicsNetbasalSpectatorNgAdd",
"title": "Install the @netbasal/spectator library options schema",
"title": "Install the @ngneat/spectator library options schema",
"type": "object",
"description": "Adds @netbasal/spectator in the package.json file and runs install dependencies.",
"description": "Adds @ngneat/spectator in the package.json file and runs install dependencies.",
"properties": {
"skipPackageJson": {
"description": "When true, does not add dependencies to the \"package.json\" file.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { <%= classify(name)%>Component } from './<%= dasherize(name)%>.component';
import { createHostComponentFactory, SpectatorWithHost } from '@netbasal/spectator';
import { createHostComponentFactory, SpectatorWithHost } from '@ngneat/spectator';
import { Component } from '@angular/core';

@Component({ selector: 'custom-host', template: '' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { <%= classify(name)%>Component } from './<%= dasherize(name)%>.component';
import { createHostComponentFactory, SpectatorWithHost } from '@netbasal/spectator';
import { createHostComponentFactory, SpectatorWithHost } from '@ngneat/spectator';

describe('<%= classify(name)%>Component', () => {
let host: SpectatorWithHost<<%= classify(name)%>Component>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { <%= classify(name)%>Component } from './<%= dasherize(name)%>.component';
import { Spectator, createTestComponentFactory } from '@netbasal/spectator';
import { Spectator, createTestComponentFactory } from '@ngneat/spectator';

describe('<%= classify(name)%>Component', () => {
let spectator: Spectator<<%= classify(name)%>Component>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { <%= classify(name)%>Directive } from './<%= dasherize(name)%>.directive';
import { createHostComponentFactory, SpectatorWithHost } from '@netbasal/spectator';
import { createHostComponentFactory, SpectatorWithHost } from '@ngneat/spectator';

describe('<%= classify(name)%>Directive ', () => {
let host: SpectatorWithHost<<%= classify(name)%>Directive>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHostFactory, SpectatorWithHost } from '@netbasal/spectator';
import { createHostFactory, SpectatorWithHost } from '@ngneat/spectator';
import { fakeAsync, tick } from '@angular/core/testing';

import { AsyncInputComponent } from './async-input.component';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/test/async/async.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { of } from 'rxjs';
import { createHostFactory, SpectatorWithHost } from '@netbasal/spectator';
import { createHostFactory, SpectatorWithHost } from '@ngneat/spectator';

import { QueryService } from '../query.service';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/test/auth.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createService } from '@netbasal/spectator';
import { createService } from '@ngneat/spectator';

import { AuthService } from './auth.service';
import { DateService } from './date.service';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/test/auto-focus.directive.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { createHostFactory, createDirectiveFactory, SpectatorDirective, SpectatorWithHost } from '@netbasal/spectator';
import { createHostFactory, createDirectiveFactory, SpectatorDirective, SpectatorWithHost } from '@ngneat/spectator';

import { AutoFocusDirective } from './auto-focus.directive';

Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/test/button/button.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createComponentFactory, mockProvider, Spectator } from '@netbasal/spectator';
import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator';
import { of } from 'rxjs';

import { QueryService } from '../query.service';
Expand Down
2 changes: 1 addition & 1 deletion projects/spectator/test/calc/calc.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createComponentFactory, Spectator } from '@netbasal/spectator';
import { createComponentFactory, Spectator } from '@ngneat/spectator';

import { CalcComponent } from './calc.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHostFactory, SpectatorWithHost } from '@netbasal/spectator';
import { createHostFactory, SpectatorWithHost } from '@ngneat/spectator';

import { DynamicComponent } from '../dynamic/dynamic.component';

Expand Down
Loading

0 comments on commit 9c19f98

Please sign in to comment.