Jest testing sample upgraded to SPFx version 1.7.0 (#720)
This commit is contained in:
parent
0b63c8a8c4
commit
a261876295
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
"@microsoft/generator-sharepoint": {
|
||||
"isCreatingSolution": true,
|
||||
"version": "1.6.0",
|
||||
"version": "1.7.0",
|
||||
"libraryName": "react-jest-testing",
|
||||
"libraryId": "9e16e13b-8d8c-4b89-8de4-dd654c5b6740",
|
||||
"environment": "spo",
|
||||
"packageManager": "npm",
|
||||
"componentType": "webpart"
|
||||
"componentType": "webpart",
|
||||
"isDomainIsolated": false
|
||||
}
|
||||
}
|
|
@ -62,7 +62,7 @@ The sample uses SPFx web part, but the same setup applies for SPFx extensions an
|
|||
|
||||
|
||||
## Used SharePoint Framework Version
|
||||
![drop](https://img.shields.io/badge/drop-1.6.0-green.svg)
|
||||
![drop](https://img.shields.io/badge/drop-1.7.0-green.svg)
|
||||
|
||||
## Applies to
|
||||
|
||||
|
@ -87,6 +87,7 @@ Version|Date|Comments
|
|||
0.0.1|May 9, 2018 | Initial commit
|
||||
0.0.2|June 12, 2018 | Update to 1.5.0, missing launch.json added
|
||||
0.0.3|September 27, 2018 | Update to 1.6.0
|
||||
0.0.4|December 10, 2018 | Update to 1.7.0
|
||||
|
||||
## Disclaimer
|
||||
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
"id": "9e16e13b-8d8c-4b89-8de4-dd654c5b6740",
|
||||
"version": "1.0.0.0",
|
||||
"includeClientSideAssets": true,
|
||||
"skipFeatureDeployment": true
|
||||
"skipFeatureDeployment": true,
|
||||
"isDomainIsolated": false
|
||||
},
|
||||
"paths": {
|
||||
"zippedPackage": "solution/react-jest-testing.sppkg"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "react-jest-testing",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.4",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
|
@ -11,41 +11,40 @@
|
|||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/sp-core-library": "1.6.0",
|
||||
"@microsoft/sp-lodash-subset": "1.6.0",
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.6.0",
|
||||
"@microsoft/sp-webpart-base": "1.6.0",
|
||||
"@pnp/common": "1.2.1",
|
||||
"@pnp/logging": "1.2.1",
|
||||
"@pnp/odata": "1.2.1",
|
||||
"@pnp/sp": "1.2.1",
|
||||
"@microsoft/sp-core-library": "1.7.0",
|
||||
"@microsoft/sp-lodash-subset": "1.7.0",
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.7.0",
|
||||
"@microsoft/sp-webpart-base": "1.7.0",
|
||||
"@pnp/common": "1.2.7",
|
||||
"@pnp/logging": "1.2.7",
|
||||
"@pnp/odata": "1.2.7",
|
||||
"@pnp/sp": "1.2.7",
|
||||
"@types/es6-promise": "0.0.33",
|
||||
"@types/react": "15.6.6",
|
||||
"@types/react-dom": "15.5.6",
|
||||
"@types/react": "16.4.2",
|
||||
"@types/react-dom": "16.0.5",
|
||||
"@types/webpack-env": "1.13.1",
|
||||
"react": "15.6.2",
|
||||
"react-dom": "15.6.2"
|
||||
"react": "16.3.2",
|
||||
"react-dom": "16.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/sp-build-web": "1.6.0",
|
||||
"@microsoft/sp-module-interfaces": "1.6.0",
|
||||
"@microsoft/sp-webpart-workbench": "1.6.0",
|
||||
"@microsoft/sp-build-web": "1.7.0",
|
||||
"@microsoft/sp-module-interfaces": "1.7.0",
|
||||
"@microsoft/sp-webpart-workbench": "1.7.0",
|
||||
"@types/chai": "3.4.34",
|
||||
"@types/enzyme": "3.1.10",
|
||||
"@types/enzyme": "3.1.15",
|
||||
"@types/jest": "22.2.3",
|
||||
"@types/mocha": "2.2.38",
|
||||
"@types/sinon": "4.3.1",
|
||||
"@types/sinon": "5.0.7",
|
||||
"ajv": "~5.2.2",
|
||||
"enzyme": "3.3.0",
|
||||
"enzyme-adapter-react-15": "1.0.5",
|
||||
"enzyme": "3.8.0",
|
||||
"enzyme-adapter-react-16": "1.7.1",
|
||||
"gulp": "~3.9.1",
|
||||
"identity-obj-proxy": "3.0.0",
|
||||
"jest": "22.4.3",
|
||||
"jest-junit": "3.7.0",
|
||||
"react-test-renderer": "15.6.2",
|
||||
"jest-junit": "5.2.0",
|
||||
"react-test-renderer": "16.6.3",
|
||||
"sinon": "5.0.7",
|
||||
"ts-jest": "22.4.5",
|
||||
"tslint-microsoft-contrib": "5.0.0"
|
||||
"ts-jest": "22.4.5"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
|
@ -70,7 +69,10 @@
|
|||
"moduleNameMapper": {
|
||||
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
|
||||
},
|
||||
"testResultsProcessor": "jest-junit",
|
||||
"reporters": [
|
||||
"default",
|
||||
"jest-junit"
|
||||
],
|
||||
"coverageThreshold": {
|
||||
"global": {
|
||||
"branches": 100,
|
||||
|
|
|
@ -34,7 +34,7 @@ export default class IceCreamShopWebPart extends BaseClientSideWebPart<IIceCream
|
|||
const element: React.ReactElement<IIceCreamShopProps> = React.createElement(
|
||||
IceCreamShop,
|
||||
{
|
||||
iceCreamProvider: new IceCreamPnPJsProvider(sp), //new IceCreamFakeProvider() // replace with Fake provider when offline workbench.
|
||||
iceCreamProvider: new IceCreamFakeProvider(), // replace with real provider when online workbench using new IceCreamPnPJsProvider(sp) instead of new IceCreamFakeProvider()
|
||||
strings: strings
|
||||
}
|
||||
);
|
||||
|
|
|
@ -8,10 +8,10 @@ export class IceCreamFakeProvider implements IIceCreamProvider {
|
|||
return new Promise<Array<IceCream>>(resolve => {
|
||||
|
||||
let list = [
|
||||
{ UniqueId: "1", Title: "Cherry" },
|
||||
{ UniqueId: "2", Title: "Chocolate" },
|
||||
{ UniqueId: "3", Title: "Coffee and Cookie" },
|
||||
{ UniqueId: "10", Title: "Vanilla" }
|
||||
{ UniqueId: "1", Title: "Cherry", Price: 1 },
|
||||
{ UniqueId: "2", Title: "Chocolate", Price: 2 },
|
||||
{ UniqueId: "3", Title: "Coffee and Cookie", Price: 2.11 },
|
||||
{ UniqueId: "10", Title: "Vanilla", Price: 2.5 }
|
||||
] as IceCream[];
|
||||
|
||||
resolve(list);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import * as React from 'react';
|
||||
import { configure, mount, ReactWrapper } from 'enzyme';
|
||||
import * as Adapter from 'enzyme-adapter-react-15';
|
||||
import * as Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
configure({ adapter: new Adapter() });
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import * as React from 'react';
|
||||
import { configure, mount, ReactWrapper} from 'enzyme';
|
||||
import * as Adapter from 'enzyme-adapter-react-15';
|
||||
import * as Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
import { IIceCreamShopProps } from '../components/IIceCreamShopProps';
|
||||
import { IIceCreamShopState } from '../components/IIceCreamShopState';
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import * as React from 'react';
|
||||
import { configure, mount, ReactWrapper} from 'enzyme';
|
||||
import * as Adapter from 'enzyme-adapter-react-15';
|
||||
import * as Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
import { IIceCreamShopProps } from '../components/IIceCreamShopProps';
|
||||
import { IIceCreamShopState } from '../components/IIceCreamShopState';
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import * as React from 'react';
|
||||
import { configure, shallow, ShallowWrapper } from 'enzyme';
|
||||
import * as Adapter from 'enzyme-adapter-react-15';
|
||||
import * as Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
import { IIceCreamShopProps } from '../components/IIceCreamShopProps';
|
||||
import { IIceCreamShopState } from '../components/IIceCreamShopState';
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import * as React from 'react';
|
||||
import { configure, mount, ReactWrapper } from 'enzyme';
|
||||
import * as Adapter from 'enzyme-adapter-react-15';
|
||||
import * as Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
import { IIceCreamShopProps } from '../components/IIceCreamShopProps';
|
||||
import { IIceCreamShopState } from '../components/IIceCreamShopState';
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import * as React from 'react';
|
||||
import { configure, mount, ReactWrapper } from 'enzyme';
|
||||
import * as Adapter from 'enzyme-adapter-react-15';
|
||||
import * as Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
import { IIceCreamShopProps } from '../components/IIceCreamShopProps';
|
||||
import { IIceCreamShopState } from '../components/IIceCreamShopState';
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
/// <reference types="jest" />
|
||||
|
||||
import * as React from 'react';
|
||||
import { configure, mount, ReactWrapper } from 'enzyme';
|
||||
import * as Adapter from 'enzyme-adapter-react-15';
|
||||
import { configure } from 'enzyme';
|
||||
import * as Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
import { IceCreamPnPJsProvider } from '../iceCreamProviders/IceCreamPnPJsProvider';
|
||||
import { IceCream } from '../iceCreamProviders/IceCream';
|
||||
import { sp, SearchResults, Items } from "@pnp/sp";
|
||||
import { sp, Items } from "@pnp/sp";
|
||||
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.2/MicrosoftTeams.schema.json",
|
||||
"manifestVersion": "1.2",
|
||||
"packageName": "Ice Cream Shop",
|
||||
"id": "d67c5975-ba3e-49ec-9a23-245c15ea3cda",
|
||||
"version": "0.1",
|
||||
"developer": {
|
||||
"name": "SPFx + Teams Dev",
|
||||
"websiteUrl": "https://products.office.com/en-us/sharepoint/collaboration",
|
||||
"privacyUrl": "https://privacy.microsoft.com/en-us/privacystatement",
|
||||
"termsOfUseUrl": "https://www.microsoft.com/en-us/servicesagreement"
|
||||
},
|
||||
"name": {
|
||||
"short": "Ice Cream Shop"
|
||||
},
|
||||
"description": {
|
||||
"short": "SPFx unit tests with Jest, Enzyme and Sinonjs",
|
||||
"full": "SPFx unit tests with Jest, Enzyme and Sinonjs"
|
||||
},
|
||||
"icons": {
|
||||
"outline": "tab20x20.png",
|
||||
"color": "tab96x96.png"
|
||||
},
|
||||
"accentColor": "#004578",
|
||||
"configurableTabs": [
|
||||
{
|
||||
"configurationUrl": "https://{teamSiteDomain}{teamSitePath}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest={teamSitePath}/_layouts/15/teamshostedapp.aspx%3FopenPropertyPane=true%26teams%26componentId=d67c5975-ba3e-49ec-9a23-245c15ea3cda",
|
||||
"canUpdateConfiguration": true,
|
||||
"scopes": [
|
||||
"team"
|
||||
]
|
||||
}
|
||||
],
|
||||
"validDomains": [
|
||||
"*.login.microsoftonline.com",
|
||||
"*.sharepoint.com",
|
||||
"*.sharepoint-df.com",
|
||||
"spoppe-a.akamaihd.net",
|
||||
"spoprod-a.akamaihd.net",
|
||||
"resourceseng.blob.core.windows.net",
|
||||
"msft.spoppe.com"
|
||||
],
|
||||
"webApplicationInfo": {
|
||||
"resource": "https://{teamSiteDomain}",
|
||||
"id": "00000003-0000-0ff1-ce00-000000000000"
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 933 B |
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
|
@ -1,7 +1,5 @@
|
|||
{
|
||||
"rulesDirectory": [
|
||||
"tslint-microsoft-contrib"
|
||||
],
|
||||
"rulesDirectory": [],
|
||||
"rules": {
|
||||
"class-name": false,
|
||||
"export-name": false,
|
||||
|
@ -28,5 +26,6 @@
|
|||
"use-named-parameter": true,
|
||||
"variable-name": false,
|
||||
"whitespace": false
|
||||
}
|
||||
},
|
||||
"extends": "@microsoft/sp-tslint-rules/base-tslint.json"
|
||||
}
|
Loading…
Reference in New Issue