Commit Graph

151 Commits

Author SHA1 Message Date
Roman Podymov
87a0b0e30b
Tests for the functions that are using KeyPath require !swift(>=5.2) (Thenable) 2020-01-14 22:03:22 +01:00
Roman Podymov
98e3f1cd28
Tests for the functions that are using KeyPath require !swift(>=5.2) (Guarantee) 2020-01-14 22:02:07 +01:00
Roman Podymov
9ea7d3daed
Fixed tests ordering 2020-01-08 22:26:55 +01:00
Roman Podymov
bf293b7395
New items in GuaranteeTests and ThenableTests 2020-01-08 21:17:06 +01:00
Roman Podymov
15a73f95cd
Tests for new mapping functions 2020-01-08 21:15:05 +01:00
Roman Podymov
35379bb8a0
struct Person and tests for new mapping functions 2020-01-08 21:12:41 +01:00
Roman Podymov
f8a593a320 Map by keyPath (#1118)
* Added func map<U>(_ keyPath: KeyPath<T, U>)

* Added swift version

* Added func map<U>(_ keyPath: KeyPath<T, U>)

* testMap

* testMap for Guarantee

* Added missing __allTests__GuaranteeTests

* Added all missing tests

* Removed #if swift

* Tests ordering

* Fixed tests
2020-01-07 17:02:16 +00:00
emrcftci
c864814c1d refactor(*): Change empty tuples to Void 2019-11-13 08:54:47 +03:00
Roman Podymov
10a10ed8bd Promise.value and Guarantee.value when T == Void (#1096)
* Promise.value when T == Void

* Guarantee.value where T == Void

* Replace class with static because Promise is final

* Optimised Guarantee.value where Value == Void

* Add comment

* Implementation with Void()

* Tests for Promise<Void>.value

* Tests for Guarantee<Void>.value

* Added tests for Promise<Void> and Guarantee<Void>
2019-09-25 13:24:39 -04:00
Roman Podymov
6303e93089
Update AnyPromiseTests.m 2019-06-28 12:58:15 +02:00
Roman Podymov
9cd56c237d
Update AnyPromiseTests.m 2019-06-28 12:33:21 +02:00
Igor Palaguta
7d3028e0ee update test manifest 2019-06-17 23:36:58 +02:00
Igor Palaguta
9f9f1f9e89 Add guarantee sequence utils 2019-06-17 17:45:55 +02:00
Max Howell
6cfdb23235 Use Swift 5 to generate linuxmain 2019-04-07 13:01:20 -04:00
Max Howell
65c42e2e13
Xcode 10.2 / Swift 5 support
Note we had to bump the Xcodeproj to Swift 4, which is thew new minimum that is supported for Xcode 10.2.

This will affect Carthage users.
2019-01-29 13:34:21 -05:00
Max Howell
7d5d5352e6
Validate that Linux has full test coverage 2019-01-23 22:46:11 -05:00
repo-ranger[bot]
c531710216
Merge pull request #991 from mxcl/fixes-990
Reverts #963 due to ambiguity (see #990)
2019-01-23 23:01:25 +00:00
Max Howell
1c958cfdb6
Reverts #963 due to ambiguity (see #990) 2019-01-23 17:19:00 -05:00
Neal Lester
ecb719a441 Log when unfulfilled guarantee is deallocated
* Fixed bug where pendingPromiseDeallocated event was incorrectly reported as a waitOnMainThread event.
* Now logs if a Guarantee is deallocated before it has been fulfilled.
2019-01-23 14:04:53 -05:00
Neal Lester
5bb2aae8cc Fixed bug where pendingPromiseDeallocated event was incorrectly repor… (#972)
* Fixed bug where pendingPromiseDeallocated event was incorrectly reported as a waitOnMainThread event. Added test which should have caught this bug in the first place.

* Kick Travis CI
2018-12-14 16:47:17 +00:00
Max Howell
5b72d28396 Rename loggingClosure to logHandler
This is more consistent with Apple API naming.
2018-12-04 15:01:48 -05:00
Neal Lester
a5ab1ea5b3 Added facilities for controlling console output
Refs #961
2018-12-04 14:48:58 -05:00
Max Howell
4e78705bac Keep code-coverage up; Keep docs coverage up 2018-11-29 12:54:13 -05:00
Max Howell
289b6a8e37
More and more Travis tweaks
* Attempting to get Travis to deploy
* Minimize Travis matrix. I believe this tests everything that matters, including older SDK and deployment targets while being kinder to Travis’s free infrastructure.
* Only run the JS/A+ tests for that test group
* Re-enable uploading to codecov
* Use xcpretty
2018-10-13 17:37:44 -04:00
Max Howell
72f3581d68 Fix travis 2018-10-03 13:49:25 -04:00
Max Howell
3a281ac8e0 Generate build.js on CI; rm -rf from sources 2018-09-28 14:51:51 -04:00
Max Howell
d3dfe22243 Increase number of sequential thens in this test
Refs #930
2018-09-28 09:53:29 -04:00
Max Howell
c7dad79d1b
Fix travis (#912)
Actually run the tests for the ones we want them
2018-08-19 14:44:46 -04:00
Max Howell
20570d3a0f Sync all subspecs (no changes to libs, just tests)
Ever more Travis tweaks
2018-06-21 01:10:31 -04:00
Max Howell
efcccf58a0 More tests for finally(on:); Tag 6.3.2 2018-06-15 12:26:20 -04:00
Max Howell
a917914b6b
Merge pull request #876 from mayurdzk/mayur/accept-queue-in-finally
Accept a queue in finally()
2018-06-15 12:18:45 -04:00
mayurdzk
4b4b30e19a Accept a queue in finally() 2018-06-15 21:17:48 +05:30
Kyle Newsome
9d70282857 Update 'Core' test target name to 'CorePromise'
More descriptive name avoids target conflicts during swift build process
when depending on multiple packages that also have a 'Core' target

- Fixes Test: LinuxMain import of Core
2018-06-13 13:34:46 -04:00
Max Howell
f846058c3a Fix tests on Linux 2018-06-10 17:57:14 -04:00
Max Howell
d427b29dd7 Allow specifying DispatchWorkItemFlags; Tag 6.3.0
This has recently become useful to me, though this is for experienced users only.
2018-06-10 13:24:26 -04:00
Derek Clarkson
5f7f09f56f Updating test to wait for results 2018-06-10 18:28:04 +10:00
Derek Clarkson
89c58298a1 Guarantee then map 2018-06-09 22:27:00 +10:00
Max Howell
c667ec78cc Add ensureThen
Couldn’t have two variants of `ensure` without the dreaded ambiguity issues.

Sadly Swift cannot infer the type for multiline closures where there are two possible functions for it to match. :(
2018-04-19 21:43:12 -04:00
zhuhao
6a0d8ceeba [ObjC] Fix error leak 2018-04-19 17:21:35 +08:00
Loïs Di Qual
65f020801e Add official Promises/A+ compliance test suite (#805)
* Library exports properly

* A bit of progress

* Try emitting mocha events

* Progress

* Progress is real

* All tests now show

* All tests run

* Proper formatting

* Proper XCTFail

* Some progress with adapters

* Not sure what's up

* Tests run with new adapter

* Add then function

* Good progress on interface

* Lots of tests now pass

* Validate onFulfilled / onRejected before calling them

* Cleanup test file

* Add todo

* Move MockNodeEnvironment to proper folder

* Use invokeMethod to call pure functions

* Fix timers

* Add some debugging

* Fix timeouts

* Catch errors when calling handlers

* Move JSPromise to own file

* Refactor JSPromise to use then/catch

* Add a bit of doc

* Catch exceptions thrown by handlers, the proper way

* Consolidate stacktrace printing

* Add availability checks

* Fully comply to 2.2.7.1

* Allow only running one test

* Add isFunction checks

* Enable 2.3.1 only for now

* Add ignored tests, handle promises as return value

* Report failures back to swift layer

* Move adapter to own file

* Use dev mode in webpack config

* More doc

* Refactor a bit

* More stuff in JSUtils

* More doc

* Add readme

* Remove some whitespace

* Add typeError func

* Use on:nil in second then

* Throw TypeError when needed

* Comment fix

* Make test suite iOS 8+ compatible

* Fix Swift 4 compile

* Fix Swift 3.1 compile

* Use babel to transpile to ES5, adds support to iOS 8/9

* Move JSUtils to proper folder

* Fix warning

* Simplify format printing

* Add 3.2 split support back

* Slight improvement

* Revert console.log format solution

* Use a reasonable timeout

* Add omittingEmptySubsequences support for 3.1
2018-03-07 09:13:00 -05:00
Max Howell
30530b0125 Remove map and flatMap deprecations
Closes #795
2018-02-25 13:40:00 -05:00
Max Howell
63a57e4039 Increase Thenable coverage all the way up 2018-02-22 16:17:51 -05:00
Max Howell
9152012f56 Test AnyPromise.result 2018-02-22 11:59:22 -05:00
Max Howell
9acd098b49 Rename some tests 2018-02-22 11:59:22 -05:00
Max Howell
0f538f2684 Fix tests on Linux 2018-02-21 14:36:29 -05:00
Max Howell
ee1063703d Increase code coverage for AnyPromise 2018-02-20 20:08:26 -05:00
Max Howell
c18f2d83fb Delete unused tests; Support swift test
Get travis to runs tests.

Means we no longer support Swift 3.1 on Linux. Sorry. Progress, etc.
2018-02-20 20:08:25 -05:00
Max Howell
c8f747f861 Code coverage improvements
Also enables warnings in tests again and silences the warnings.

Also stops us testing code coverage for tests during CI.
2018-02-20 17:54:59 -05:00
Max Howell
7f7bb7f52d Fix: builds failing, but leaving green lights
Well great. This series of fixes, fixes builds failing but looking like they passed, and fixes the issues that were failing.

Fortunately it was just compile issues in the tests, no tests were failing.

For me this proves that YAML sucks, BASH sucks and TRAVIS sucks.
2018-02-19 15:56:29 -05:00
Max Howell
59847871ba Xcode 9.3 / Swift 4.1 / Swift 3.3 updates
Strictly I’d feel better to test all configurations, but PromiseKit only uses Foundation, so the chance that for some reason there is an API break or worse some kind of runtime issue is pretty low and I feel that we have to be kinder to Travis’s free infrastructure.

Tag 6.0.2
2018-02-16 15:26:52 -05:00